Discussion Forums  >  Audio, Video, Playing, Recording

Replies: 15    Views: 333

perrytheweaver
Apple Fan
Profile
Posts: 51
Reg: Jun 14, 2011
Rowlett, TX
3,460
02/07/13 10:07 AM (12 years ago)

So here's a new problem with streaming audio in iOS

Have my iPhone hooked up to Xcode, and when I start my app and run it on the phone and try to play an mp3 stream (not just a file), I hear nothing. Try the same thing on an iPhone emulator via Xcode, and the streaming mp3 plays great. Odd thing is, I swear the stream was playing on my actual phone via Xcode (not the emulator) just a couple of days ago! Am stumped...again. Is there a control panel setting that might account for this oddity?
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
02/07/13 10:21 AM (12 years ago)
I know it sounds mad, but is the mute button switched on, I spent hours one long night trying to figure out why the sound wasn't playing, the volume shows as high but the switch was actually muted
 
perrytheweaver
Apple Fan
Profile
Posts: 51
Reg: Jun 14, 2011
Rowlett, TX
3,460
like
02/07/13 10:29 AM (12 years ago)
I don't think so. Where is the "mute" button? Is it not on the audio player itself...
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
02/07/13 10:30 AM (12 years ago)
it's the switch on the side of the phone
 
perrytheweaver
Apple Fan
Profile
Posts: 51
Reg: Jun 14, 2011
Rowlett, TX
3,460
like
02/07/13 10:33 AM (12 years ago)
Oh my...you are now officially on my Christmas card list! That was it...duh...how silly...totally embarrassed! You are...wonderful :-)
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
02/07/13 10:36 AM (12 years ago)
Isn't it annoying when it is so simple. The other night I was testing audio and for the life of me couldn't figure why the sound wasn't playing. Checked the mute button, volume. I left the bloody headphones in and obviously they weren't in my ears.
 
perrytheweaver
Apple Fan
Profile
Posts: 51
Reg: Jun 14, 2011
Rowlett, TX
3,460
like
02/07/13 10:37 AM (12 years ago)
hahahahah...I feel your pain!
 
Rad Doc
Apple Fan
Profile
Posts: 653
Reg: Oct 08, 2010
USA, NYC
8,580
like
02/07/13 12:02 PM (12 years ago)
There are a few changes you need to do to make sure you correct the mute/silent issue before you publish it to the appstore and get negative reviews. In your Xcode Project find your BT_Config folder, in this folder you will find yourAppName_appDelegate.m file....scroll down pretty far in this file to around line 880 just after the array list of .mp3 sound effects you will see this code //setup audio session for background sounds. Allow iPod to continue if it's already playing. [[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryAmbient error: nil]; [[AVAudioSession sharedInstance] setActive: YES error: nil]; NOW just after that code paste the code below...you should now have audio and video playing regardless of mute switch on side of device...i tested and worked for me. // prevent mute switch from switching off audio from movie player NSError *_error = nil; [[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayback error: &_error];
 
Rad Doc
Apple Fan
Profile
Posts: 653
Reg: Oct 08, 2010
USA, NYC
8,580
like
02/07/13 12:14 PM (12 years ago)
 
perrytheweaver
Apple Fan
Profile
Posts: 51
Reg: Jun 14, 2011
Rowlett, TX
3,460
like
02/07/13 12:33 PM (12 years ago)
good! any suggestions for android in this regard?
 
perrytheweaver
Apple Fan
Profile
Posts: 51
Reg: Jun 14, 2011
Rowlett, TX
3,460
like
02/07/13 01:16 PM (12 years ago)
Im actually using a javascript audio player so hope your muting suggestion applies to that also.
 
perrytheweaver
Apple Fan
Profile
Posts: 51
Reg: Jun 14, 2011
Rowlett, TX
3,460
like
02/10/13 01:39 PM (12 years ago)
Just a note to follow up on the youtube tutorial noted above: that is for a BT 1.5 app, not for 2.0. But the other code for keeping the mute button from silencing the app is great!
 
Rad Doc
Apple Fan
Profile
Posts: 653
Reg: Oct 08, 2010
USA, NYC
8,580
like
02/10/13 06:06 PM (12 years ago)
Perry, Although the video shows the process for a 1.5 app, it works when implemented in 2.0
 
perrytheweaver
Apple Fan
Profile
Posts: 51
Reg: Jun 14, 2011
Rowlett, TX
3,460
like
02/14/13 09:24 AM (12 years ago)
Excellent, RadDoc. Client just requested this :-)
 
perrytheweaver
Apple Fan
Profile
Posts: 51
Reg: Jun 14, 2011
Rowlett, TX
3,460
like
02/14/13 09:59 AM (12 years ago)
Problem with YouTube tutorial noted above, that should work for my BZ 2.0 project: He talks about cutting/pasting code in this file: BT_Screens/BT_screen_audio.m Or even just an audio.m file. I don't have either of those in my custom URL app. In fact I searched all the files in this xcode project and the code he references in the tutorial ( "[controlBox setBackgroundColor...]" ) does not exist anywhere in my project. What did I miss?
 
Frogman
Aspiring developer
Profile
Posts: 264
Reg: Jan 05, 2013
Bratislava
11,190
like
03/16/13 03:15 PM (12 years ago)
Kittsy, you rock! Reading your tip above solved my problem, it was the mute button. You saved the second half of my hair. Thanks. Frogman
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.