• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSSound + NSBundle
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSSound + NSBundle


  • Subject: Re: NSSound + NSBundle
  • From: Jake Sprouse <email@hidden>
  • Date: Sat, 21 Apr 2007 18:16:29 -0700

http://developer.apple.com/documentation/Cocoa/Reference/ ApplicationKit/Classes/NSSound_Class/Reference/Reference.html

"The NSSound class provides a simple interface for loading and playing AIFF, WAV, and NeXT “.snd” files. NSSound supports 16-bit, mono and stereo, 44.1KHz and 22.05KHz data."

Could this have something to do with the errors you're seeing? BTW, it's very helpful to post the errors you're trying to deal with.



On Apr 21, 2007, at 6:04 PM, Tim Simon wrote:

I have a program that plays sounds that are added into the project.
Whilst this works fine, i want to be able to select a song that is in
any directory on my Mac, without adding it specifically to the project
itself.
To initialize the first song, this code is used:

	song1 = [[NSSound alloc] initWithContentsOfFile:[thisBundle
pathForResource:@"sound1" ofType:@"mp3"] byReference:YES];

I tried using a NSTextField to allow the user to enter the path for
the sound, and then use

	song1 = [[NSSound alloc] initWithContentsOfFile:[thisBundle
pathForResource:[NSTextField stringValue] ofType:@"mp3"]
byReference:YES];

to play, but this comes up with errors. I belive that it is something
to do with the NSBundle that is used, but im not sure how to actually
change it so it works.

Cheers, Tim
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
40jakesprouse.net


This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


  • Follow-Ups:
    • Re: NSSound + NSBundle
      • From: "Tim Simon" <email@hidden>
References: 
 >NSSound + NSBundle (From: "Tim Simon" <email@hidden>)

  • Prev by Date: NSSound + NSBundle
  • Next by Date: Re: [Cocoa] How convert ":Developer:Private:jam" into a path POSIX-style
  • Previous by thread: NSSound + NSBundle
  • Next by thread: Re: NSSound + NSBundle
  • Index(es):
    • Date
    • Thread