Audio Queues

Moderator
Posts: 613
Joined: 2004.09
Post: #46
Mediashock try lowering the buffer.

Kyle Richter
DragonForged.com
Twitter: @kylerichter
Quote this message in a reply
Apprentice
Posts: 8
Joined: 2008.09
Post: #47
just tried lowering it.. and i am not seeing a difference using m4a .. going to try mp3 to see if mp3 helps
Quote this message in a reply
Nibbie
Posts: 1
Joined: 2008.10
Post: #48
Wow, I can't tell how many hours I spent on audio. Thanks for the great example, works like a charm.

If anybody has a problem with an mp3, use iTunes to convert. I used ffmpeg which resulted in an error when creating a queue. It will also cause an badaccess exception.

Anyway, cheers! Smile
Quote this message in a reply
Moderator
Posts: 3,572
Joined: 2003.06
Post: #49
Glad to help, gawd0r! Smile

Yes, I too have noticed that iTunes tends to produce files that work better with Audio Toolbox.
Quote this message in a reply
Nibbie
Posts: 2
Joined: 2008.10
Post: #50
First of...thank you for the 'GBMusicTrack' class..it's a big help Smile

BUT...(there's aways a but, isn't there)...when I try and use it on my iphone, it only plays the music through the headset speaker...any ideas on how to make it play through the 'regular' speaker?

Thanks!

rwc
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #51
unplug the headphones?
Quote this message in a reply
Nibbie
Posts: 2
Joined: 2008.10
Post: #52
I tried getting the GBMusicTrack class to work using a remote URL (for an mp3), but I couldn't get it to work. Has anyone else had any success?
Quote this message in a reply
Nibbie
Posts: 2
Joined: 2008.10
Post: #53
I tried using GBMusicTrack to play an mp3 on a remote server, and I couldn't get it to work. Has anyone done this before? What do I need to do in order to play an mp3 over http?
Quote this message in a reply
Moderator
Posts: 613
Joined: 2004.09
Post: #54
To my knowledge GBMusicTrack was never designed to do that, but have you tried storing the remote MP3 to NSData then passing it through GBMusic?

Kyle Richter
DragonForged.com
Twitter: @kylerichter
Quote this message in a reply
Moderator
Posts: 3,572
Joined: 2003.06
Post: #55
I never intended for GBMusicTrack to be used to do anything but play background music off a local disk. Streaming/remote/whatever else just wasn't in the plan, sorry.

If you can figure out how to do it though, I'm sure there'd be a lot of interest. kodex' idea seems like it might actually work. Cache the remote file to local disk and read frames from it on the fly maybe?
Quote this message in a reply
Nibbie
Posts: 1
Joined: 2008.11
Post: #56
AnotherJake Wrote:Heck, well for Mac, all you had to do was ask! Smile

Well, now that we've all got the new NDA... (well I got mine -- didn't you get yours?!) Actually, just in case you didn't.

So, I used your code, and it plays my .aif file very nicely. But I'd like it to play .mp3 Or .m4a. The problem is, I keep getting

2008-11-05 17:00:17.437 MyApp[36592:20b] Error loading /Library/QuickTime/DivX Decoder.component/Contents/MacOS/DivX Decoder: dlopen(/Library/QuickTime/DivX Decoder.component/Contents/MacOS/DivX Decoder, 262): Symbol not found: _SCDynamicStoreCopyConsoleUser

Hopefully, this is a general problem, and not one confined to very-small Macs... Wink

Thanks!
Quote this message in a reply
Moderator
Posts: 3,572
Joined: 2003.06
Post: #57
Chumm Wrote:Well, now that we've all got the new NDA...

Oh yeah, I forgot about that: Yes, GBMusicTrack now works for iPhone too.

.mp3 and .m4a should work just fine. Unfortunately, a couple weeks ago I received an email from a fellow named Ravi who listed the same log message as you. I don't know if he ever got that resolved, but it seemed not. I even sent him a known test project and that didn't work either, which was completely bizarre.

For iPhone, AFAIK, it shouldn't be referencing an OS X framework, which is what it appeared to be doing according to his log. And what the heck would SCDynamicStoreCopyConsoleUser have anything to do with anything related to audio playback?

So unfortunately, I have absolutely no idea what's up with that message. It seems to work fine for everyone else. Doing a quick google for _SCDynamicStoreCopyConsoleUser shows some results for other folks having similar problems. Doesn't look good...

[edit] Well this is kind of weird, but I actually wound up dealing with a situation just like this myself a little while ago this evening. I Googled it and this thread popped up on this page. So in case someone else stumbles into it too, a few posts down from this one, jrbosser posts a link to another relevant page which says one solution is to remove 3rd party components, which worked for me too : http://discussions.apple.com/thread.jspa...ID=1650506
Quote this message in a reply
Nibbie
Posts: 1
Joined: 2008.11
Post: #58
AnotherJake, thanks for posting this code. Very helpful! I'm using it for the iphone.

There's one problem I'm having, which I also have with the soundengine.cpp in the CrashLanding app. I get memory leaks.
Quote this message in a reply
Moderator
Posts: 3,572
Joined: 2003.06
Post: #59
iphonemediaman Wrote:AnotherJake, thanks for posting this code. Very helpful! I'm using it for the iphone.
Glad you like it! Smile

Quote:There's one problem I'm having, which I also have with the soundengine.cpp in the CrashLanding app. I get memory leaks.

Yes, Audio Queues seems to have some leaks. I filed it as a bug with Apple a while back, but haven't heard anything back on it. The leaks are pretty minor from what I've seen in my own stuff and heard from others, and so far haven't resulted in any App Store rejections that I am aware of.
Quote this message in a reply
Member
Posts: 50
Joined: 2008.06
Post: #60
Do you know if this should work okay with .amr files? I keep having callbackForBuffer called before the file is actually done playing. Then the whole phone freezes up and I have to restart it.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Core Audio mutlichannel audio tachyon 2 6,175 Mar 18, 2005 01:04 AM
Last Post: tachyon