Hi all,

I am trying to play a .mp3 file on click of a button using this code:

 NSString 
<http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ObjC_classic/Classes/NSString.html>
*audioFilePath=[[audioInputTextField stringValue]
stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];NSURL
<http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ObjC_classic/Classes/NSURL.html>
*audioUrl = [[NSURL
<http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ObjC_classic/Classes/NSURL.html>
alloc] initWithString:audioFilePath];
QTMovie* soundToPlay = [[QTMovie alloc] initWithURL:audioUrl
error:nil];[soundToPlay play];


Here user is expected to enter a valid url for an audio file in text
field and then click button next to it to play, but it is not working
for me ie. no audio gets played :(

Can anyone suggest me, if I am doing anything wrong?

The sample code can be downloaded from here- http://db.tt/cDjFCZO

One of the example links which I tried was -
http://javamax.free.fr/sonorisation%20et%20radio/Linken%20Park%20-%20In%20The%20End.mp3
-- 
Thanks,

Devarshi
_______________________________________________

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 arch...@mail-archive.com

Reply via email to