Audio plays only static/hiss

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
rumplestiltskin
Posts: 223
Joined: Wed Jun 21, 2006 7:33 pm
Contact:

Audio plays only static/hiss

Post by rumplestiltskin » Fri May 03, 2013 5:35 am

Using the Community Edition on my Mac. When I attempt to play an imported audio file of any sort (mp3, aiff, wav), all I get is static or hiss or something best described as audio distortion of some sort. Just in case my stack was corrupted, I quit LC, re-started, re-launched LC, created a new stack, imported a known-good audio file (that played fine in the Finder and with QT Player) and got the same result - bad audio hiss/distortion.

Known bug in the new version or ???

Thanks,
Barry

EDIT: Hmm...also happening in v4.6.4 Commercial. Tried referencing the audio using the QT Player object and the sound plays properly. It is a puzzlement.
Last edited by rumplestiltskin on Fri May 03, 2013 6:21 am, edited 1 time in total.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Audio plays only static/hiss

Post by Simon » Fri May 03, 2013 6:17 am

Hi Barry,
http://forums.runrev.com/phpBB2/viewtop ... mp3#p57677
That should get you going.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

rumplestiltskin
Posts: 223
Joined: Wed Jun 21, 2006 7:33 pm
Contact:

Re: Audio plays only static/hiss

Post by rumplestiltskin » Fri May 03, 2013 6:38 am

Simon,

Just exported the .m4a as a .aif (using QT Player Pro). Imported into LC and same result (weird distortion).

Maybe I'm using the wrong code?
play "3Sec.aif" (not working)
play audioClip "3Sec.aif" (not working)

If I create a player object and reference the clip, it plays fine when I click the player's play button. Using the Message box with the Player's fileName:
play audioClip "/Users/blevine/Downloads/3Sec.aif" results in garbage (with or without the word audioClip).

Edit: The player object works programmatically:
start player "Player"
...that plays the referenced file properly. It's the imported file that doesn't play. I'm attaching that file to this post. Perhaps someone might test it and let me know if it plays in your stack. Thanks!
Attachments
Tick.aif.zip
(30.82 KiB) Downloaded 227 times
Last edited by rumplestiltskin on Fri May 03, 2013 6:47 am, edited 1 time in total.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Audio plays only static/hiss

Post by Simon » Fri May 03, 2013 6:44 am

Hi Barry,
It's:
set fileName of player "myPlayer" to "/Users/blevine/Downloads/3Sec.aif"
start player "myPlayer"

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: Audio plays only static/hiss

Post by bn » Fri May 03, 2013 8:49 am

Hi Barry,

it seems to be a sampling problem, not all AIFs are equal.

I used
aif_Settings.png
aif_Settings.png (33.07 KiB) Viewed 6919 times
and converted your aif to
Tick2.aif.zip
(4.58 KiB) Downloaded 224 times
and that works.

Other settings might work also but you would have to try.

Kind regards
Bernd

rumplestiltskin
Posts: 223
Joined: Wed Jun 21, 2006 7:33 pm
Contact:

Re: Audio plays only static/hiss

Post by rumplestiltskin » Fri May 03, 2013 6:11 pm

Yep; looks like all I had to do was use the 16 bit. I may have set it to 24 bit during an earlier export unrelated to what I was doing with LiveCode and it "stuck" there. Thanks so much for your help!

Barry

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Audio plays only static/hiss

Post by Klaus » Fri May 03, 2013 6:25 pm

Hi Barry,

Livecode is VERY picky when it come to "play ac XYZ"!
Use a player object whereever possible!

One of the stretch goals of the Kickstarter Project was an overhaul of the multimedia engine,
lets hope they will implement that very soon!

Hint:
For these low quality sounds you can also use the AU format, which plays fine with "play ac XYZ"!
Use 8 or 16 bit sample size and 11.025, 22.050 or 44.100 sample rate.
Files are quite small, too!


Best

Klaus

rumplestiltskin
Posts: 223
Joined: Wed Jun 21, 2006 7:33 pm
Contact:

Re: Audio plays only static/hiss

Post by rumplestiltskin » Fri May 03, 2013 7:22 pm

Klaus wrote:{snip}...
Hint:
For these low quality sounds you can also use the AU format, which plays fine with "play ac XYZ"!
Use 8 or 16 bit sample size and 11.025, 22.050 or 44.100 sample rate.
Files are quite small, too!...{snip}
Will those work in Windows and iOS apps, as well?

Thanks,
Barry

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Audio plays only static/hiss

Post by Simon » Fri May 03, 2013 8:46 pm

I stick with the player object and mp3.
Everything plays mp3 now.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Audio plays only static/hiss

Post by Klaus » Sat May 04, 2013 12:14 pm

Hi Barry,
rumplestiltskin wrote:
Klaus wrote:{snip}...
Hint:
For these low quality sounds you can also use the AU format, which plays fine with "play ac XYZ"!
Use 8 or 16 bit sample size and 11.025, 22.050 or 44.100 sample rate.
Files are quite small, too!...{snip}
Will those work in Windows and iOS apps, as well?
yes, AU will also "play" well on Windows!

But not on iOS, since Livecode on iOS does not support internal sounds anyway! 8)
No idea if iOS will play AU files at all, sorry.

Best

Klaus

Post Reply