Re: NSSound won't play wave files???
Re: NSSound won't play wave files???
- Subject: Re: NSSound won't play wave files???
- From: Charles Srstka <email@hidden>
- Date: Mon, 7 Jul 2008 02:01:25 -0500
On Jul 7, 2008, at 1:53 AM, Jason Bobier wrote:
Has anyone else had issues playing wave files with NSSound? Not only
does it refuse to play the file (even tho I can open it with the
Quicktime Player and play it), but it fails to error. It simply
doesn't make a sound. AIFF files seem to play just fine. Here is the
code in a generic project.
@implementation TestController
- (void)awakeFromNib
{
BOOL success;
NSSound *sound = [[NSSound alloc] initWithContentsOfFile:@"/Users/
jason/Desktop/306.wav" byReference:YES];
// NSSound *sound = [[NSSound alloc] initWithContentsOfFile:@"/Users/
jason/Desktop/306.aif" byReference:YES];
success = [sound play];
NSLog(@"%d", (int)success);
}
@end
Very straight forward. The sound allocs and inits just fine and
success is YES after play is called. Not only does it fail to make a
sound, but it also fails to call my sound finished delegate.
Looking in the Console, I get this mysterious error:
7/7/08 2:41:51 AM Test[29698] com.apple.console Warning 1
whenever the sound is played.
Any ideas???
Since it works in QuickTime Player, have you tried using QTMovie
instead of NSSound to play the file?
Charles
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden