本文介绍了有没有办法限制Codename One中音频捕获的持续时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Codename One应用中,我需要将音频捕获的持续时间限制为几秒钟。为此,我称 Capture.captureAUdio()似乎并不等同于 Capture.capturePhoto(w,h)可以将捕获的音频限制到给定的持续时间。



到目前为止,我所做的是测量音频捕获的持续时间,如果时间过长,则询问如果愿意,用户可以重新开始。



还有什么可以做的更好的事情吗?



任何提示都值得赞赏,

解决方案

否。



对于音频,虽然可以使用use MediaManager 的媒体录制功能,它不如 Capture 直观,但允许更多细粒度控制。 / p>

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,

解决方案

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.

这篇关于有没有办法限制Codename One中音频捕获的持续时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-22 00:19