m4a

How to record voice in .m4a format

流过昼夜 提交于 2019-12-30 02:28:12
问题 Already I have created an iPhone application to record. It will record in .caf file. But I want to record in .m4a format. Please help me to do this. Thanks. 回答1: Here is an alternative code sample that will encode the file as AAC inside an m4a: NSArray *dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *docsDir = [dirPaths objectAtIndex:0]; NSURL *tmpFileUrl = [NSURL fileURLWithPath:[docsDir stringByAppendingPathComponent:@"tmp.m4a"]];

How to record voice in .m4a format

烈酒焚心 提交于 2019-12-30 02:28:05
问题 Already I have created an iPhone application to record. It will record in .caf file. But I want to record in .m4a format. Please help me to do this. Thanks. 回答1: Here is an alternative code sample that will encode the file as AAC inside an m4a: NSArray *dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *docsDir = [dirPaths objectAtIndex:0]; NSURL *tmpFileUrl = [NSURL fileURLWithPath:[docsDir stringByAppendingPathComponent:@"tmp.m4a"]];

ID3 tags with Swift

醉酒当歌 提交于 2019-12-30 01:01:06
问题 I'm looking for a way to modify ID3 tags with Swift. More specifically, I want to write the Album Art image to an mp3/m4a file. A Swift library would be the best, but I'll take anything that can be done natively in Swift. I don't want to rely on another language's library. I had a quick look at AVFoundation, but it looks like it's only for audio/video playback and conversion. This is about the closest I found from ID3 tags: https://developer.apple.com/library/mac/documentation/AVFoundation

iOS用AVAudioPlayer播放m4a音频

余生颓废 提交于 2019-12-28 23:26:05
音频文件sound.m4a放到Supporting Files目录 引用头文件 # import <AVFoundation/AVFoundation.h> 定义一个全局的属性: @property (nonatomic, strong) AVAudioPlayer *player; //音频播放器 //初始化音频播放器 NSString *path = [[NSBundle mainBundle] pathForResource:@"sound" ofType:@"m4a"]; self.player = [[AVAudioPlayer alloc] initWithData:[NSData dataWithContentsOfFile:path] error:nil]; self.player.numberOfLoops = 1; self.player.volume = 1.0; //播放 [self.player play]; 来源: https://www.cnblogs.com/JayK/p/3958267.html

Javasound not playing .m4a files through JAAD (an SPI)

僤鯓⒐⒋嵵緔 提交于 2019-12-23 16:26:33
问题 I'm trying to play some .m4a files, and I understand that JAAD only supports decoding AAC, but there are songs that I am able to get the sourceDataLine from, and then when I go to try to play them, I get behavior like this: We read: 1024 bytes. We read: 512 bytes. We read: -1 bytes. When running this: // read from the input bytesRead = audioInputStream.read(tempBuffer, 0, tempBuffer.length); System.out.println("We read: " + bytesRead + " bytes."); until bytesRead == -1 For this particular

what is AudioStreamBasicDescription for m4a file format

喜你入骨 提交于 2019-12-23 12:12:00
问题 I have tried with more AudioStreamBasicDescription for m4a file format. Still I am getting some issues with that. Please anyone tell me the exact AudioStreamBasicDescription for m4a file format. 回答1: you can use ExtAudioFileGetProperty to get the ASBD from existing m4a audio file. For more details Click here. 回答2: You can get ASBD of a file with 2 (at least) different methods. You can use 'ExtAudioFileGetProperty' or 'AudioFileGetProperty'. AudioFileGetProperty: NSString *soundFilePath = [

ffmpeg音频文件转换之使用stdin/stdout或BytesIO对象输入输出

给你一囗甜甜゛ 提交于 2019-12-20 03:06:06
最近在搞小程序录音,然后使用百度接口做语音识别。 小程序目前仅支持mp3和aac编码格式。虽然百度接口提供的m4a格式支持能直接识别小程序的录音文件,但由于自己还有其他一系列需求(比如直接读取数据,根据需要进行分段等),我还是希望能把m4a文件转换成pcm编码的文件。 后端使用ffmpeg命令如下: # 基于文件操作 ffmpeg -n -i input-1576685164r111.m4a -acodec pcm_s16le -f wav -ac 1 -ar 8000 output-8k-mono.wav 但是如果你用Python从网上下载一个文件,(比如我把文件存在百度对象存储,BOS),你可能更倾向于使用BytesIO这种内存文件。 这时ffmpeg基于文件的转换操作需要你建立一个临时文件,转换后再将其删除,这需要你在文件系统上进行操作,效率低而且比较麻烦。 是时候了解ffmpeg基于stdin、stdout的操作了: # 仅输入使用pipe cat input-1576685164r111.m4a | ffmpeg -n -i pipe: -acodec pcm_s16le -f wav -ac 1 -ar 8000 output-8k-mono.wav # 或全使用pipe cat input-1576685164r111.m4a | ffmpeg -n -i pipe:

What is the difference between M4A and AAC Audio Files?

别来无恙 提交于 2019-12-18 12:13:23
问题 is there a difference between M4A audio files and AAC audio files or are they exactly the same thing but with a different file extension ? 回答1: .M4A files typically contain audio only and are formatted as MPEG-4 Part 14 files ( .MP4 container). .AAC is not a container format and instead it is a raw MPEG-4 Part 3 bitstream with audio stream encoded. Note that M4A does not have to contain exactly AAC audio, there are other valid options as well. 回答2: There are raw video and audio streams, this

Play m4a in python script with mplayer

六眼飞鱼酱① 提交于 2019-12-13 19:50:35
问题 I'm posting to a URL, downloading an audio file (m4a) and trying to play it from the terminal with a Python script. When I type mplayer asdf.m4a in the terminal it plays fine. But when I execute the following code from mplayer import Player player = Player() player.loadfile('asdf.m4a') as shown in the mplayer guide, I get the following errors: mplayer: could not connect to socket mplayer: No such file or directory I've been trying to figure this out for a couple days now and it seems like it

How can I export an mp3 file from an iOS device's iPod library?

别说谁变了你拦得住时间么 提交于 2019-12-12 08:35:05
问题 In my iOS application I'm trying to export an mp3 file from the iPod library to the app's documents directory on the device. Currently I'm trying to use AVAssetExportSession but it's not working for mp3 files. It works well for m4a files. Is exporting an mp3 file possible using AVAssetExportSession? What is the appropriate outputFileType for AVAssetExportSession? ( AVFileTypeAppleM4A works for m4a files) Thanks! 回答1: I am facing the same problem. Unfortunately, non of the iOS frameworks