• 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
Robust audio playback using NSSound...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Robust audio playback using NSSound...


  • Subject: Robust audio playback using NSSound...
  • From: patrick machielse <email@hidden>
  • Date: Fri, 12 Aug 2005 17:00:15 +0200

I'm developing a component which should (try to) play back arbitrary sound files. The file formats should be the regular Quicktime suspects: aiff, wav, mp3, au, etc. I'm using the NSSound class, which advertises its sound file support through the method -[NSSound soundUnfilteredFileTypes].

At first I created NSSound objects using:

- (id)initWithContentsOfFile:(NSString *)path byReference:(BOOL)byRef
Sound objects created this way play all promised file formats, and even go beyond the 'documentation' by also supporting .mid and .mov file playback. However, file support goes over the top when NSSound objects happily start playing .txt, .htm., and .pdf files...


I then resorted to creating NSSound object with:

- (id)initWithData:(NSData *)data

These sound objects will correctly refuse to 'play' text files. New problem: some mp3 files that played earlier will no longer play, and I am not able to play _any_ .m4a files (no DRM) which also play fine when I use initWithContentsOfFile.

I hope someone has tackled these problems and knows a workaround. The documentation sure doesn't help; it's about 4 years out of date :-(

patrick
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Robust audio playback using NSSound...
      • From: m <email@hidden>
  • Prev by Date: NSTable View Selected Cell question
  • Next by Date: Re: What are some reasons why my App is not loading the NIB?
  • Previous by thread: Re: NSTable View Selected Cell question
  • Next by thread: Re: Robust audio playback using NSSound...
  • Index(es):
    • Date
    • Thread