黑莓录音示例代码
有谁知道有一个好的存储库可以获取 BlackBerry 的示例代码吗? 具体来说,可以帮助我学习录制音频的机制的示例,甚至可能对其进行采样并对其进行一些动态信号处理?
我想读取传入的音频,如果需要的话可以逐个采样,然后对其进行处理以产生所需的结果,在本例中是可视化工具。
Does anyone know of a good repository to get sample code for the BlackBerry? Specifically, samples that will help me learn the mechanics of recording audio, possibly even sampling it and doing some on the fly signal processing on it?
I'd like to read incoming audio, sample by sample if need be, then process it to produce a desired result, in this case a visualizer.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
RIM API 包含JSR 135 Java Mobile Media API,用于处理音频和音频 视频内容。
您纠正了 BB 知识库上的混乱情况。 唯一的办法就是浏览它,希望他们不会再更改站点地图。
这是开发人员->资源->知识库 ->Java API 和示例->音频和视频
音频录制 录制
音频基本上很简单:
链接:
RIM 4.6.0 API 参考:包 javax .microedition.media
如何 - 在 BlackBerry 智能手机上录制音频
操作方法 - 在应用程序中播放音频
操作方法 - 支持将音频流式传输到媒体应用程序
如何 - 指定音频路径路由
如何 - 从媒体应用程序获取媒体播放时间
什么是 - 支持的音频格式
什么是 - 媒体应用程序错误代码 声明
带有播放器、RecordControl 和资源的音频记录示例
线程:
在 Thread.run() 上开始音频录制:
在 thread.stop() 上停止录制:
处理和采样音频流
在录制结束时,您将获得充满特定音频格式数据的输出流。 因此,要处理或采样它,您必须解码该音频流。
谈到即时处理,那会更加复杂。 您必须在记录期间读取输出流,而无需提交记录。 因此,将有几个问题需要解决:
也可能有用:
java .net:Java ME 中的流内容实验,作者:Vikram Goyal
RIM API contains JSR 135 Java Mobile Media API for handling audio & video content.
You correct about mess on BB Knowledge Base. The only way is browse it, hoping they'll not going to change site map again.
It's Developers->Resources->Knowledge Base->Java API's&Samples->Audio&Video
Audio Recording
Basically it's simple to record audio:
Links:
RIM 4.6.0 API ref: Package javax.microedition.media
How To - Record Audio on a BlackBerry smartphone
How To - Play audio in an application
How To - Support streaming audio to the media application
How To - Specify Audio Path Routing
How To - Obtain the media playback time from a media application
What Is - Supported audio formats
What Is - Media application error codes
Audio Record Sample
Thread with Player, RecordControl and resources is declared:
On Thread.run() audio recording is started:
And on thread.stop() recording is stopped:
Processing and sampling audio stream
In the end of recording you will have output stream filled with data in specific audio format. So to process or sample it you will have to decode this audio stream.
Talking about on the fly processing, that will be more complex. You will have to read output stream during recording without record commiting. So there will be several problems to solve:
Also may be useful:
java.net: Experiments in Streaming Content in Java ME by Vikram Goyal
虽然不是特定于音频的,但这个问题确实有一些很好的“入门”参考。
编写 Blackberry 应用程序
While not audio specific, this question does have some good "getting started" references.
Writing Blackberry Applications
我也花了很长时间试图弄清楚这一点。 安装 BlackBerry Component Pack(可从其网站获取)后,您可以在组件包内找到示例代码。
就我而言,将组件包安装到 Eclipse 后,我在以下位置找到了提取的示例代码:
不幸的是,当我导入所有示例代码时,出现了一堆编译错误。 为了解决这个问题,我删除了 20% 有编译错误的包。
我的下一个问题是启动模拟器总是启动第一个示例代码包(在我的例子中是 activetextfieldsdemo),我无法让它只运行我感兴趣的包。解决方法是删除之前按字母顺序列出的所有包我想要的那个。
其他问题:
-右键单击 Eclipse 中的项目并选择“Activate for BlackBerry”
-选择黑莓-> 构建配置...-> 编辑...并选择您的新项目以便构建。
- 确保将 BlackBerry 源代码放在 Eclipse 项目的“src”文件夹下,否则可能会遇到构建问题。
I spent ages trying to figure this out too. Once you've installed the BlackBerry Component Packs (available from their website), you can find the sample code inside the component pack.
In my case, once I had installed the Component Packs into Eclipse, I found the extracted sample code in this location:
Unfortunately when I imported all that sample code I had a bunch of compile errors. To workaround that I just deleted the 20% of packages with compile errors.
My next problem was that launching the Simulator always launched the first sample code package (in my case activetextfieldsdemo), I couldn't get it to run just the package I am interested in. Workaround for that was to delete all the packages listed alphabetically before the one I wanted.
Other gotchas:
-Right click on the project in Eclipse and select Activate for BlackBerry
-Choose BlackBerry -> Build Configurations... -> Edit... and select your new project so it builds.
-Make sure you put your BlackBerry source code under a "src" folder in the Eclipse project, otherwise you might hit build issues.