[英]How do I read time samples of audio files in Android?
I want to write an app on Android to record snoring sounds of a sleeper and analyze it afterwards (ie, not in real-time) for signs of a medical condition called obstructive sleep apnea. 我想在Android上编写一个应用程序,以记录睡眠者的打nor声,然后(即不是实时地)对其进行分析,以发现被称为阻塞性睡眠呼吸暂停的医疗状况。
The Android devices I've experimented with have voice recorders that produce a file format called .3ga. 我尝试过的Android设备具有录音机,录音机产生的文件格式称为.3ga。 I want to programmatically read in the audio file and look at the amplitude for each individual time-sample. 我想以编程方式读取音频文件,并查看每个单独时间样本的幅度。 Then I can analyze that for patterns. 然后,我可以分析模式。 Would this be easier if I converted this to a different format, eg, MP3, and if so how can I do that programmatically? 如果将其转换为其他格式(例如MP3),会更容易吗?如果可以,我该如何通过编程实现呢?
I did a Google search on this and most of the hits seemed to be related to audio recording or playback which are unrelated to what I'm trying to do. 我对此进行了Google搜索,大多数匹配似乎与录音或播放有关,而与我尝试执行的操作无关。 I haven't coded anything yet because I don't know how to get started. 我还没有编码,因为我不知道如何开始。
You are looking to do sample-based analysis on a raw audio signal, but the formats you mention are compressed. 您希望对原始音频信号进行基于样本的分析,但是您提到的格式已压缩。 You will need to either deal with raw samples directly, or decompress the audio and then analyze. 您将需要直接处理原始样本,或者解压缩音频然后进行分析。
Since you said you can do this work after-the-fact, why not upload to a server and analyze there? 既然您说可以事后进行这项工作,那么为什么不上传到服务器并在那里进行分析呢?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.