Is there a way to limit the duration of an audio capture in Codename One?

女生的网名这么多〃 提交于 2019-12-08 04:07:08

问题


In my Codename One app, I need to limit the duration of an audio capture to few seconds. I call Capture.captureAUdio() for that and there does not seem to be an equivalent to Capture.capturePhoto(w, h) that could bound the captured audio to a given duration.

What I've done so far is measure the audio capture duration and if it is too long then ask the user to start again if they will. But I find it a bit cumbersome.

Is there anything better that can be done ?

Any hint appreciated,


回答1:


No.

For audio though you can use use the media recording feature from MediaManager which isn't as intuitive as Capture but allows more "fine grained" control.



来源:https://stackoverflow.com/questions/41129436/is-there-a-way-to-limit-the-duration-of-an-audio-capture-in-codename-one

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!