problem importing audio files

Visuals, audio, animation. Blended, not stirred. If LiveCode is part of your rich media production toolbox, this is the forum for you.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
maxs
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 421
Joined: Sat Jun 24, 2006 12:02 am
Contact:

problem importing audio files

Post by maxs » Wed Oct 19, 2011 7:33 am

OK I need to use a decent sound editing program, (not quicktime) to record my voice. I tried SoundTrack pro, Soundbooth, and SoundConverer, and a few other programs, all of which save to both .aif and .wav. But when I import them to Livecode all I get is stactic.

How can I get decent audio into Livecode?

Max

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: problem importing audio files

Post by Dixie » Wed Oct 19, 2011 10:52 am

maxs...

I am making the assumption that the audio file that you have plays without a problem outside of the liveCode environment...

To play a file from liveCode that you have not imported as an audioClip try something like this...

Code: Select all

on mouseUp
   answer file "Select Audio File to play"
   if it is not empty then
      play it
   end if
end mouseUp
To play an audioClip that you have imported into liveCode

Code: Select all

on mouseUp
   play audioclip 1
end mouseUp
Hope that helps

Dixie

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

Re: problem importing audio files

Post by Klaus » Wed Oct 19, 2011 11:19 am

Hi Max,

LiveCode does only supports a few (OLD!) formats for internal sound!
AIFF and WAV, but UNCOMPRESSED!
AU, which is compressed by nature.

For everything else you should use external files "referenced" in a player object.


Best

Klaus

johnmiller1950
Posts: 116
Joined: Mon Apr 30, 2007 3:33 pm

Re: problem importing audio files

Post by johnmiller1950 » Sun Oct 30, 2011 2:45 pm

Max,

I had a problem like this. I tried to use LiveCode's record command, but the sound was terrible. Then I experimented with the various recording settings. Now, I get pretty good recordings inside LiveCode. The code I use is attached below.

Best Regards,
John Miller

on mouseUp
set the recordInput to "imic"
set the recordformat to "aiff" --- CAN ALSO USE "WAVE", "ULAW" & "MOVIE"
set the recordChannels to 2 -- STEREO
set the recordCompression to "raw " -- NONE
set the recordRate to 48.00
set the recordsampleSize to 16
put specialfolderpath ("Desktop") & "/My Recording.aiff" into fileXX
record sound file fileXX
end mouseUp

maxs
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 421
Joined: Sat Jun 24, 2006 12:02 am
Contact:

Re: problem importing audio files

Post by maxs » Sun Oct 30, 2011 7:33 pm

Thank you John.

That must have been a bit of experimenting. It's great to have the right numbers. At least I can record now, even though I still can't use soundtrack pro or Soundbooth with these settings .

Max

maxs
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 421
Joined: Sat Jun 24, 2006 12:02 am
Contact:

Re: problem importing audio files

Post by maxs » Tue Nov 29, 2011 8:41 am

Hi Klaus,
When you say internal sound --- do you mean 'imported' sounds?

I tried importing uncompressed AU, aiff and wav files from other apps, like soundbooth, but they screech, too.
LiveCode does only supports a few (OLD!) formats for !
AIFF and WAV, but UNCOMPRESSED!
AU, which is compressed by nature.


Max

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

Re: problem importing audio files

Post by Klaus » Tue Nov 29, 2011 9:53 am

Hi Max,
maxs wrote:Hi Klaus,
When you say internal sound --- do you mean 'imported' sounds?
Yes, the ones that won't play on iOS! 8)
maxs wrote:I tried importing uncompressed AU, aiff and wav files from other apps, like soundbooth, but they screech, too.
LiveCode does only supports a few (OLD!) formats for !
AIFF and WAV, but UNCOMPRESSED!
AU, which is compressed by nature.
Theses formats SHOULD work, but that is not guaranteed! :?
So I finally ended with imported sounds in AU format and use a player object with external files whenever possible.

LiveCode really needs an overhaul of its multimedia playback engine for sounds and video!


Best

Klaus

maxs
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 421
Joined: Sat Jun 24, 2006 12:02 am
Contact:

Re: problem importing audio files

Post by maxs » Wed Nov 30, 2011 8:02 am

Thanks Klaus,

I'm so glad I am not the only one who believes audio and video files need a overhaul.

Max

teacherguy
Posts: 379
Joined: Thu Dec 08, 2011 2:43 am

Re: problem importing audio files

Post by teacherguy » Sun Dec 11, 2011 1:04 pm

I was surprised to see how old this thread was, yet I was still having audio import issues... the "static" mentioned above. Changing my sounds to 16 bit fixed the problem for me.

Post Reply