NSSound won't play wave files???

2008-07-07 Thread Jason Bobier
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???

Thanks!

Jason
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: NSSound won't play wave files???

2008-07-07 Thread Charles Srstka

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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: NSSound won't play wave files???

2008-07-07 Thread Jason Bobier

BTW, this:

- (void)awakeFromNib
{
BOOL success;
NSError *error = nil;

	QTMovie *sound = [[QTMovie movieWithFile:@/Users/jason/Desktop/ 
306.wav error:error] retain];


[sound play];

NSLog(@%d, (int)success);
}


works fine.


On Jul 7, 2008, at 2: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???

Thanks!

Jason
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/jbobier%40mac.com

This email sent to [EMAIL PROTECTED]


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: NSSound won't play wave files???

2008-07-07 Thread Jason Bobier

Hey Charles,

I just did and that worked fine, so at least I have a work around. :-)

Jason

On Jul 7, 2008, at 3:01 AM, Charles Srstka wrote:


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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]