Combining sound files

Having trouble using an XCmd or XFcn? Post your questions here.

Combining sound files

Postby psyscott » Thu Mar 12, 2009 8:45 am

This might not be the right place to post this question, but I assume it will require an external.

I want to join (concatenate) a lot of AIFF sound files into a single, long (60-90 second) sound files. I want to script this with Supercard.

Can this be accomplished without an external? Are there any Supercard externals available to help do this?

Thanks for any suggestions.

Scott Saults
Research Associate
Dept of Psychological Sciences
University of Missouri
psyscott
 
Posts: 3
Joined: Thu Mar 12, 2009 8:37 am

Re: Combining sound files

Postby johncollett » Thu Mar 12, 2009 10:34 am

I am currently joining lots of .wav files into a single file. (Single spoken sentences into continuous dialogue.) I am using an Applescript obtained, if I remember correctly, from Lisa Williams. This works perfectly. I use the resulting long file in SC, but I do not do the merging in SC. (I use drag and drop in Finder.) Putting the script into, say, an SC button should be possible. Want more details?
J
User avatar
johncollett
 
Posts: 100
Joined: Sat Aug 02, 2008 2:53 pm

Re: Combining sound files

Postby psyscott » Sat Mar 14, 2009 8:21 pm

Yes, jcollett, I'd like more details.

I can't use a simple drag and drop, because I have to construct each file from a list of many files combined in a specific order. I have a method that will work. I create and save a list of file names in SuperCard. I then open the list in the freeware, Praat, and use a Praat script to open all of the files, concatenate them, and save the result. It might be more efficient to pass the list of files from SuperCard directly to an Applescript and have it combine them, so I'd like to look into this possibility.

Thanks!
psyscott
 
Posts: 3
Joined: Thu Mar 12, 2009 8:37 am

Re: Combining sound files

Postby Ken Norris » Sun Mar 15, 2009 12:18 pm

Hody,

I have a question ...

psyscott wrote:Yes, jcollett, I'd like more details.

I can't use a simple drag and drop, because I have to construct each file from a list of many files combined in a specific order. I have a method that will work. I create and save a list of file names in SuperCard. I then open the list in the freeware, Praat, and use a Praat script to open all of the files, concatenate them, and save the result. It might be more efficient to pass the list of files from SuperCard directly to an Applescript and have it combine them, so I'd like to look into this possibility.


I wonder if there's a way to append audio files by using SC's QTRecord external and just have it record a playlist of files.

I'm working on a project that parses XML for iTunes playlists (extracts a list of actual file names from XML references) for a cueing project that can be programmed to play between up to 4 sets (for now) of playlists.

I know there is a way to append sound files together into one using QT movies, which I've done before, but I've forgotten how for the moment.

Ken N.

Ken N.
All the best,
Ken N.
http://fhtinyradio.com/
kenn@fhtinyradio.com
User avatar
Ken Norris
 
Posts: 284
Joined: Mon Nov 03, 2008 7:27 pm

Re: Combining sound files

Postby Ken Norris » Sun Mar 15, 2009 2:29 pm

Hi Scott,

psyscott wrote:This might not be the right place to post this question, but I assume it will require an external.

I want to join (concatenate) a lot of AIFF sound files into a single, long (60-90 second) sound files. I want to script this with Supercard.


I'm not sure why you have to make a single file from other sounds.

1) Why can't you just make a playlist which will play the files one after the other in any order you like? IOW, 10 tracks are 10 tracks ... whether or not you combine them into one file shouldn't matter to the listener ... it will basically sound the same. It's true there will be a slight break from one to the next, but otherwise you're asking for an audio editor, which SC is not.

2) If that won't work, then you have to edit them together in some way anyway. If you have iLife, you already own what is probably the easiest and most complete audio editing software (of its kind) in the world: GarageBand. Just drag your sound files into a track butted together one after the other, then bounce it to iTunes.

3) If you don't have GarageBand, go get Audacity:
http://audacity.sourceforge.net/


HTH,
Ken N.
All the best,
Ken N.
http://fhtinyradio.com/
kenn@fhtinyradio.com
User avatar
Ken Norris
 
Posts: 284
Joined: Mon Nov 03, 2008 7:27 pm

Re: Combining sound files

Postby psyscott » Sun Mar 15, 2009 8:13 pm

Hi Ken

Ken Norris wrote:Hi Scott,
I'm not sure why you have to make a single file from other sounds.

1) Why can't you just make a playlist which will play the files one after the other in any order you like? IOW, 10 tracks are 10 tracks ... whether or not you combine them into one file shouldn't matter to the listener ... it will basically sound the same. It's true there will be a slight break from one to the next, but otherwise you're asking for an audio editor, which SC is not.

I will not be playing the sound files in SuperCard, but as part of an experiment to be run with the software Psyscope. In Psyscope, there's no good way to play a long list of separate sounds and, at the same time, conduct a series of reaction time trials on the same computer, asynchronous with the sounds. A 'playlist' is irrelevant.
2) If that won't work, then you have to edit them together in some way anyway. If you have iLife, you already own what is probably the easiest and most complete audio editing software (of its kind) in the world: GarageBand. Just drag your sound files into a track butted together one after the other, then bounce it to iTunes.

Yes, of course a variety of sound editors can do this. I know Audicity and several other sound editors. For this kind of audio work I prefer Praat, especially in this case because one can script Praat's editing and manipulation commands. Since no SuperCard solution was forthcoming, I have written a script for Praat that will first open a text file with a list of file names (created in SuperCard), then open each file on the list, combine them into a single file, and finally save the resulting sound file. Since I'm using SuperCard to randomize and generate the lists of files that I'll need to concatenate, it would be really nice to complete the task in SuperCard, rather than export the file lists to be used in another program. A simple sound editing program would be very tedious for my purpose. I'll need to create at least 60 composite files, each composed of 30-150 segments from 20 different sound files. That a lot of "dragging" and "bouncing." Also, I'd prefer an efficient and convenient solution, in case I need to do this again, which is very likely.

I'm aware that Supercard is not a sound editing program; thank for the clarification. That's the reason that I posted this question under "Using Externals." I assumed that Supercard probably would require an external to do anything much with sound files, other than just play them. I have some vague memory of some HyperCard externals that could manipulate and combine sound files. As someone has mentioned, there might be a way to do this with Qucktime externals and certainly with AppleScript. Someone who understood AIFF header information might even be able to write a script to combine sound files (if SuperCard handles binary data), since you would just have to take out the header data, join the remaining data, and then write a new header, taking into account the additional sound data and file length. However, I don't know enough about the structure of sound files to do this.
3) If you don't have GarageBand, go get Audacity:
http://audacity.sourceforge.net/

Thanks, but I have audacity, which is good freeware but not useful to me in this case. And thanks for your suggestions. As of now, I have a reasonable solution, but I'm open to a better one. I'd like to automate the entire procedure in Supercard, if that were possible; doesn't sound like it is.
Best,
Scott
psyscott
 
Posts: 3
Joined: Thu Mar 12, 2009 8:37 am

Re: Combining sound files

Postby niozzo » Thu May 21, 2009 3:21 pm

Any progress on doing this within SuperCard?

I may need to so the same thing. If not, could you post the URL to look at the applescript that can do this.

Thanks,
-Nick
User avatar
niozzo
 
Posts: 12
Joined: Mon Jul 07, 2008 4:31 am

Re: Combining sound files

Postby Ken Norris » Tue Jun 23, 2009 11:31 am

niozzo wrote:Any progress on doing this within SuperCard?

I may need to so the same thing. If not, could you post the URL to look at the applescript that can do this.

Thanks,
-Nick


Might try here:
<http://dougscripts.com/itunes/itinfo/jointogether.php>

HTH ...
All the best,
Ken N.
http://fhtinyradio.com/
kenn@fhtinyradio.com
User avatar
Ken Norris
 
Posts: 284
Joined: Mon Nov 03, 2008 7:27 pm

Re: Combining sound files

Postby Ken Norris » Tue Jun 23, 2009 11:33 am

Oops ... I keep forgetting this forum has weird protocols ...

Try here:
http://dougscripts.com/itunes/itinfo/jointogether.php
All the best,
Ken N.
http://fhtinyradio.com/
kenn@fhtinyradio.com
User avatar
Ken Norris
 
Posts: 284
Joined: Mon Nov 03, 2008 7:27 pm

Re: Combining sound files

Postby johncollett » Tue Jun 23, 2009 2:59 pm

Re "Combining sound files": I had said "Want more details?" and psyscott had said "Yes, jcollett, I'd like more details." Did I not see this request at the time? Did I see it and forget to do anything about it? Whatever... Apologies for the delay, and here is a summary of how I combine sound files. The discussion has progressed into areas which are beyond my simple needs and wishes, so the following may now be irrelevant, but it is a method which I continue to use.

I have lots of recordings of Chinese dialogues. They are stored as QT movies. I play them a line at a time, repeat each line aloud, and record my repetitition of each line (I have a Logitech microphone on my desk). Then I combine my repetitions of all the lines of each dialogue into one sound file. (How I get QT to play a dialogue one line at a time is another matter.)

The XText XRtn "QTRecordSound" is installed in the project, and the SC window contains, among other things, a "START" button, a "Play" button, and a field (cd fld 6) which contains the number of the current line. I press the "START" button, wait for its name to change to "STOP", and then I say aloud the line of the dialogue. When I've finished, I click again the same button , now named "STOP". If I want a quick check on how it sounds, I press the "Play" button. I can keep on trying until my version sounds more or less similar to the original.

The recording of each line goes into a "Recordings" folder on my Desktop. If I've done, say, four lines, that folder will contain the following : Line1.wav / Line2.wav / Line3.wav / Line4.wav / MergeMovies
MergeMovies is an AppleScript app. I select lines 1 to 4, drop them on to MergeMovies, and wait a few seconds while QT gets to work and combines the four movies into one. The final movie produced by QT contains all the files, in sequence, and I export it to a .wav file. I use "Wavepad" for final polishing : reducing background noise, amplification, etc.

Here are the scripts (someone will tell me how I should have inserted them here):
The "START/STOP" button :
on mouseup
if short name of me ="START" then
set fillFore of me to 36
put "Macintosh HD:Users:johncollett:Desktop:Recordings:" & cd fld 6 into f
get QTRecordSound( "start",f,0 )
set name of me to "STOP"
else
get QTRecordSound( "stop")
set name of me to "START"
set fillFore of me to 227
end if
end mouseup

The "Play" button :
on mouseup
set the movieIdle to true
put "Macintosh HD:Users:johncollett:Desktop:Recordings:" & cd fld 6 into moov
play sound using QuickTime file moov
end mouseup

The "MergeMovies" script (with acknowledgements to Lisa Thompson) :
on open these_items
tell application "Finder" to set sorted_items ¬
to sort these_items by name
repeat with i from 1 to the count of sorted_items
set this_item to (item i of sorted_items)
tell application "QuickTime Player"
if i is equal to 1 then
make new document
end if
open this_item
tell document 1
rewind
select all
copy
select none
end tell
close document 1 saving no
tell document 1
add
select none
end tell
end tell
end repeat
end open
User avatar
johncollett
 
Posts: 100
Joined: Sat Aug 02, 2008 2:53 pm


Return to Using Externals

Who is online

Users browsing this forum: No registered users and 1 guest

cron