简体   繁体   English

如何在Android中读取音频文件的时间样本?

[英]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.

相关问题 如何在Android中多次播放多个音频文件? - How do I play multiple audio files multiple times in android? 如何从developer.android网站导入示例? - How do I import the samples from the developer.android website? 我如何运行android兼容包示例 - How do i run android comaptibity package samples 如何在Android上进行录音并进行音频和视频时间同步 - How to do audio recording on Android and make the audio and video time synchronization 如何使用JTransforms分析和显示ExoPlayer音频样本的频谱? - How do I use JTransforms to analyze and display the frequency spectrum of audio samples from ExoPlayer? MediaCodec-如何同步同步混合来自两个Decoder MediaCodec对象的音频样本? - MediaCodec - How do I mix audio samples from two Decoder MediaCodec objects in sync? 如何在Web中使用Android播放原始样本PCM_16音频数据记录(使用Web-Audio或其他方法)? - How can i play raw samples PCM_16 audio data record from Android in Web (using Web-Audio or other)? 如何将16位.wav音频文件读入适合写入Android AudioTrack的缓冲区? - How do I read a 16 bit .wav audio file into a buffer suitable for writing to an Android AudioTrack? 在Android中对PCM音频样本进行升采样 - Upsampling of PCM audio samples in Android 如何获取Android中音频的帧长? - How do i get the framelength of audio in android?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM