MCSimpleAudioPlayer
Simple local audio file player
Simple local audio file player
Home Page: http://msching.github.io/blog/2014/08/09/audio-in-ios-6/
Simple local audio file player
你好,在MCAudioOutputQueue中定义了一个MCAudioQueueBufferCount常量,想知道为什么这个值会被定义成2,写成1不行吗?比较好奇为什么这个地方会被循环,我试了下改成1,也能完整的播放完,谢谢
在MCSimpleAudioPlayer.m里的第248行代码多余了,
[_audioFile seekToTime:_seekTime];
Hi, I can't get a caf file to play.. I added this line in the demo vc:
NSString *path = [[NSBundle mainBundle] pathForResource:@"sigma" ofType:@"caf"];
_player = [[MCSimpleAudioPlayer alloc] initWithFilePath:path fileType:kAudioFileCAFType];
Any ideas what I can look for?
Thanks
非常感谢你的iOS音频播放系列文章,阅读你的代码的时候发现个小疑问
在MCAudioFile.m的第119行的for循环:
for (int i = 0; i * sizeof(AudioFormatListItem) < formatListSize; i += sizeof(AudioFormatListItem))
是不是应该为:
for (int i = 0; i * sizeof(AudioFormatListItem) < formatListSize; i++)
或者:
for (int i=0; i < formatListSize; i += sizeof(AudioFormatListItem)
会导致声音无限播放。
怎么播放在线音频
你好,看到楼主写的关于音频的博文,感觉非常好! 楼主是网易的吧?
程序在前台中断可以正常播放,在后台中断无法重新播放,设置setActive会失败报错信息是AUIOClient_StartIO failed (560557684)
我用AudioQueue录音,录音回调里直接用MCAudioOutputQueue播放, 出现死等_mutexWait方法。
经测试, 录音类型AudioQueue的数据回调,和播放类型AudioQueue的数据回调, 固定都是同一线程,线程名叫:“com.apple.coreAudio.AQClient”
因此如果在AudioQueue 录音数据回调里直接调用"[MCAudioOutputQueue playData: packetCount: packetDescriptions:]",
来播放音频数据,一旦走到“ _mutexWait”方法, 就会出现“等待_cond和激活_cond在同一线程”的情形,导致线程卡死。
如何支持播放3gp格式的音频?
like this?
` NSString *path = [[NSBundle mainBundle] pathForResource:@"20180505225621" ofType:@"3gp"];
_player = [[MCSimpleAudioPlayer alloc] initWithFilePath:path fileType:kAudioFile3GPType];
`
get error:
MCSimpleAudioPlayerDemo[3853:2235173] 3526: MP4Parser_PacketProvider->GetASBD() failed
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.