Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 11-22-2008, 09:00 PM   #1 (permalink)
Registered Member
 
Join Date: Sep 2008
Location: Portland, Oregon
Posts: 46
higgins is on a distinguished road
Default Error -1500 using AudioServicesCreateSystemSoundID ?

Hey gang,

I've got a weird simulator error related to sounds. My app loads a series of sounds (12 of them) in AIFF 4:1 44.1kHz mono format, as exported by QuickTime Pro.

On the device, everything works fine and I get no errors related to sound.

However in the simulator, two of the sounds spit an error upon load:

Code:
2008-11-22 18:50:27.422 My App[9606:20b] Error -1500 loading sound at path: /Users/higgins/Library/Application Support/iPhone Simulator/User/Applications/537A8435-3AAE-4189-ABA7-0A7C7C0316AB/My App.app/applause_long.aif
2008-11-22 18:50:27.423 My App[9606:20b] Error -1500 loading sound at path: /Users/higgins/Library/Application Support/iPhone Simulator/User/Applications/537A8435-3AAE-4189-ABA7-0A7C7C0316AB/My App.app/laughter_final.aif
Now...it still seems to WORK (doesn't crash), but the error seems odd to me. I tried recompressing the files and otherwise fiddling around, but the simulator just doesn't seem to like them.

From some Googling, I gather that -1500 is an "unspecified" error. That ain't too helpful. The only difference about these sounds (versus the other 10) is that they're bigger files. The other 10 files are 64k or under (real tiny); these two are 116k and 252k (5 sec and 11 sec respectively)...still pretty tiny, right? Is it possible that this is related?

Last edited by higgins; 12-04-2008 at 10:21 AM.
higgins is offline   Reply With Quote
Old 11-29-2008, 09:39 AM   #2 (permalink)
Registered Member
iPhone Dev SDK Supporter
 
Join Date: Nov 2008
Location: Banks, Oregon
Posts: 3
skinchin is on a distinguished road
Default Error -1500 using AudioServicesCreateSystemSoundID ?

Any progress toward a solution to this? I am having a similar problem, but seemingly regardless of caf file size.
skinchin is offline   Reply With Quote
Old 11-29-2008, 10:22 AM   #3 (permalink)
Registered Member
 
Join Date: Sep 2008
Location: Portland, Oregon
Posts: 46
higgins is on a distinguished road
Default

No progress on this issue. The app still seems to run fine on all my test devices (all flavors of iPhones and iPod touches) but the simulator still complains.
higgins is offline   Reply With Quote
Old 04-04-2009, 09:01 PM   #4 (permalink)
Registered Member
 
Join Date: Feb 2009
Posts: 18
wyattbiker is on a distinguished road
Default

Quote:
Originally Posted by higgins View Post
No progress on this issue. The app still seems to run fine on all my test devices (all flavors of iPhones and iPod touches) but the simulator still complains.
Anyone with answers to this? Sound plays on the device but not on the simulator. I tried both wav and aif. Small 6sec files <100k

AudioServicesCreateSystemSoundID(baseURL, &pmph);
returns an error, I am using iPod 2.2.1 and Mac OS X 10.5.5.
Thanks


Here is the code.
Code:
	[self playSound: @"mysound" musicType: @"wav"] ;


-(void)playSound: (NSString *) fileName musicType: (NSString *) fileType {
	SystemSoundID pmph; 
	id sndpath = [[NSBundle mainBundle] pathForResource:fileName ofType: fileType]; 
	CFURLRef baseURL = (CFURLRef) [[NSURL alloc] initFileURLWithPath:sndpath];
	OSStatus error=AudioServicesCreateSystemSoundID(baseURL, &pmph); 
	if (error != kAudioServicesNoError) { // failed
		NSLog(@"Error %d loading sound", error);
	}
	
	AudioServicesPlaySystemSound(pmph);

}
wyattbiker is offline   Reply With Quote
Old 04-04-2009, 09:49 PM   #5 (permalink)
Registered Member
 
Join Date: Feb 2009
Posts: 18
wyattbiker is on a distinguished road
Default

Quote:
Originally Posted by wyattbiker View Post
Anyone with answers to this? Sound plays on the device but not on the simulator. I tried both wav and aif. Small 6sec files <100k

AudioServicesCreateSystemSoundID(baseURL, &pmph);
returns an error, I am using iPod 2.2.1 and Mac OS X 10.5.5.
Thanks


Here is the code.
Code:
	[self playSound: @"mysound" musicType: @"wav"] ;


-(void)playSound: (NSString *) fileName musicType: (NSString *) fileType {
	SystemSoundID pmph; 
	id sndpath = [[NSBundle mainBundle] pathForResource:fileName ofType: fileType]; 
	CFURLRef baseURL = (CFURLRef) [[NSURL alloc] initFileURLWithPath:sndpath];
	OSStatus error=AudioServicesCreateSystemSoundID(baseURL, &pmph); 
	if (error != kAudioServicesNoError) { // failed
		NSLog(@"Error %d loading sound", error);
	}
	
	AudioServicesPlaySystemSound(pmph);

}

UPDATE: After using Audacity to shorten the file in increments of 1sec, I found out only files <=4.9sec long will play in the simulator. File size is irrelevant (one file was 800K+) and Stereo at 44100. So anyone with ideas, or should I report this as a buig?

I even used Apples 'caf' format.
wyattbiker is offline   Reply With Quote
Old 04-08-2009, 11:12 PM   #6 (permalink)
Registered Member
 
Join Date: Sep 2008
Location: Portland, Oregon
Posts: 46
higgins is on a distinguished road
Default

Quote:
Originally Posted by wyattbiker View Post
UPDATE: After using Audacity to shorten the file in increments of 1sec, I found out only files <=4.9sec long will play in the simulator. File size is irrelevant (one file was 800K+) and Stereo at 44100. So anyone with ideas, or should I report this as a buig?

I even used Apples 'caf' format.
Interesting. Yeah, I have just been living with this issue (bug?) for a while now -- it definitely only affects the simulator, and does feel like an Apple bug to me. I have several apps in the store using these kinds of sound files, and they definitely work on customers' devices, make it through the approval process, etc.

I'd say go ahead and radar it.
higgins is offline   Reply With Quote
Old 04-21-2009, 12:40 PM   #7 (permalink)
New Member
 
Join Date: Feb 2009
Posts: 86
seanrice is on a distinguished road
Default

Yea! We've seen this 4.9sec bug too, only ... I didn't realize until just now that the device would play a full 30. Still, .WAV files are humongously overfat files and if you've got something long to play ... AVFoundation looks to be the solution.

I have a question, assuming one is just figuring all this out now (!) ... how does one free the resources allocated by a SystemSoundID played file properly?

CODE:
- (void)playSound:(NSString *)thisSound {
NSLog(@"GVC:playSound: %@", thisSound);

if (thisSound != nil) {
SystemSoundID soundID;
NSString *thisSoundsPath = [[NSBundle mainBundle] pathForResource:thisSound ofType:@"wav"];
OSStatus err = AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath:thisSoundsPath], &soundID);
if (err) {
NSLog(@"*** WARNING *** Error occurred assigning sound!");
}
AudioServicesAddSystemSoundCompletion(soundID, NULL, NULL, SoundFinished, thisSoundsPath);
AudioServicesPlaySystemSound(soundID);
CFRunLoopRun();
}
}

When played, the sound calls this simple routine Constants.h:

static void SoundFinished (SystemSoundID soundID, void *sound2dispose)
{
/* finished playing, freeing resources */
AudioServicesDisposeSystemSoundID(sound2dispose);
CFRelease(sound2dispose);
CFRunLoopStop(CFRunLoopGetCurrent());
NSLog(@"cleaning ... %@", sound2dispose);

}

BUT i'm crashing more now than ever. Obviously over-releasing or releasing too soon, i don't know.
seanrice is offline   Reply With Quote
Old 08-01-2009, 09:35 AM   #8 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 3
dspeckleback is on a distinguished road
Default

Quote:
Originally Posted by higgins View Post
Hey gang,

I've got a weird simulator error related to sounds. My app loads a series of sounds (12 of them) in AIFF 4:1 44.1kHz mono format, as exported by QuickTime Pro.

On the device, everything works fine and I get no errors related to sound.

However in the simulator, two of the sounds spit an error upon load:

Code:
2008-11-22 18:50:27.422 My App[9606:20b] Error -1500 loading sound at path: /Users/higgins/Library/Application Support/iPhone Simulator/User/Applications/537A8435-3AAE-4189-ABA7-0A7C7C0316AB/My App.app/applause_long.aif
2008-11-22 18:50:27.423 My App[9606:20b] Error -1500 loading sound at path: /Users/higgins/Library/Application Support/iPhone Simulator/User/Applications/537A8435-3AAE-4189-ABA7-0A7C7C0316AB/My App.app/laughter_final.aif
Now...it still seems to WORK (doesn't crash), but the error seems odd to me. I tried recompressing the files and otherwise fiddling around, but the simulator just doesn't seem to like them.

From some Googling, I gather that -1500 is an "unspecified" error. That ain't too helpful. The only difference about these sounds (versus the other 10) is that they're bigger files. The other 10 files are 64k or under (real tiny); these two are 116k and 252k (5 sec and 11 sec respectively)...still pretty tiny, right? Is it possible that this is related?
I believed I've tracked down the cause of the -1500 error. I had a simple test app for sounds; which worked fine but when testing another sound, the mysterious -1500 error appeared. I was using a simple WAV file I grabbed from the net that was less than 1 second in duration. I discovered than when looking at 'More Info' on the file, the duration and frequency couldn't be determined; even though the file played perfectly in Audacity or iTunes. I loaded the file in Audacity and resaved it in the same format. The duration and frequency was now available and the -1500 error disappeared.

So I suspect the real issue was a matter of formatting within the sound file (perhaps Windows vs Mac formatting)? Although I'm sure someone out there could shed more light on the actual issue, this resolved the problem for me. Hope this helps!
dspeckleback is offline   Reply With Quote
Old 08-01-2009, 02:45 PM   #9 (permalink)
Registered Member
 
Join Date: Feb 2009
Posts: 18
wyattbiker is on a distinguished road
Default

Quote:
Originally Posted by dspeckleback View Post
I believed I've tracked down the cause of the -1500 error. I had a simple test app for sounds; which worked fine but when testing another sound, the mysterious -1500 error appeared. I was using a simple WAV file I grabbed from the net that was less than 1 second in duration. I discovered than when looking at 'More Info' on the file, the duration and frequency couldn't be determined; even though the file played perfectly in Audacity or iTunes. I loaded the file in Audacity and resaved it in the same format. The duration and frequency was now available and the -1500 error disappeared.

So I suspect the real issue was a matter of formatting within the sound file (perhaps Windows vs Mac formatting)? Although I'm sure someone out there could shed more light on the actual issue, this resolved the problem for me. Hope this helps!
I agree. I resaved and it worked.

Also, FYI. mp3 formats play in simulator but not on device. For anyone wondering, stick with caf.
wyattbiker is offline   Reply With Quote
Reply

Bookmarks

Tags
error, kaudioservicesnoerror, sound, soundeffect

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 366
7 members and 359 guests
blueorb, fredidf, iAppDeveloper, iGamesDev, mottdog, sacha1996, Touchmint
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,667
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, host number one
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 03:32 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0