Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSSound and private embedded frameworks



2006/1/3, Philip Dow <email@hidden>:
> Boisy, you may want to try the following.
>
> First, get the NSBundle object for your framework using :
>
>         NSBundle *myFrameworkBundle = [NSBundle
> bundleWithIdentifier:@"com.myframework.name"];
>
> Then get the path to the sound file using
>
>         NSString *soundPath = [myFrameworkBundle
> pathForResource:@"MySoundName" ofType:@"wav"];

A better idea would be to use:

NSString *soundPath = [myFrameworkBundle pathForSoundResource: @"MySoundName"];

That way, it will work even if the file's format/type is changed (to
aiff, mp3, whatever)

>
> Make sure the sound file ends in the .wav extension. That sound path
> should be a complete path whether using the framework or the
> application. Use that path to initialize your NSSound object - (id)
> initWithContentsOfFile:(NSString *)path byReference:(BOOL)byRef

--
Clark S. Cox III
email@hidden
My CV/Resume:
http://homepage.mac.com/clarkcox3/files/Resume.pdf
http://homepage.mac.com/clarkcox3/files/Resume.html
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden

References: 
 >NSSound and private embedded frameworks (From: Boisy Pitre <email@hidden>)
 >Re: NSSound and private embedded frameworks (From: Philip Dow <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.