recording audio
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
recording audio
Hi, all. Could someone tell me the status of audio recording in LiveCode? I know things got interrupted by the demise of QuickTime. Has this been dealt with LC 8 or 9? If so, is there a pertinent tutorial anywhere on how to do recording and playback? I’m making some language-learning apps, and want to allow learners to record themselves to compare their pronunciations with those provided in the app. Playback is a snap, but I don’t know how to record. Thanks!
Minogaade
Minogaade
Re: recording audio
This is my own code which works well for a recording button:-
Then I use this to playback:-
As you can see the key functions to use are:-
mergMicrophoneStartRecording [filename.wav]
mergMicrophoneStopRecording
Hope that helps!
Code: Select all
on mouseUp
if mergMicrophoneIsRecording() is true then
mergMicrophoneStopRecording
set the label of button "record" to "Record Audio Now!"
set the backgroundColor of button "record" to "red"
else
mergMicrophoneStartRecording test.wav
set the label of button "record" to "Recording..."
set the backgroundColor of button "record" to "blue"
local x
repeat with x = 0 to 100
set the label of button "record" to x
end repeat
wait for 1 seconds
mergMicrophoneStopRecording
set the label of button "record" to "Record Audio Now!"
set the backgroundColor of button "record" to "red"
end if
end mouseUp
Code: Select all
on mouseUp
play test.wav
set the label of button "Playback" to "Playing back..."
set the backgroundColor of button "Playback" to "blue"
wait until the sound is done
set the label of button "Playback" to "Play back"
set the backgroundColor of button "Playback" to "green"
end mouseUp
mergMicrophoneStartRecording [filename.wav]
mergMicrophoneStopRecording
Hope that helps!
Re: recording audio
Super! That works well. Thank you so much for taking the time to answer my question.
Re: recording audio
Okay, I’ve been playing with this and it works very well for recording and comparison of pronunciation with a native speaker. However, there is one small problem, and that it is that there is almost always a "tick" sound at the beginning of my recording. This may not be a LiveCode issue, but I’m wondering if anyone knows why this happens and if there’s any way to prevent it. I’m using a very fast recent-model MacBook Pro.
Re: recording audio
A little experimentation shows that if I use
mergMicrophoneSetNumberOfChannels mono
i.e., set the number of channels to 1, then the tick seems to only occur the first time I record a sound on a new page. I’ll have to test things on other computers, too. Wish I knew more about sound and the many parameters of recording!
mergMicrophoneSetNumberOfChannels mono
i.e., set the number of channels to 1, then the tick seems to only occur the first time I record a sound on a new page. I’ll have to test things on other computers, too. Wish I knew more about sound and the many parameters of recording!
Re: recording audio
Also you may want to try this little hack:-
Essentially this starts it recording, then immediately stops recording, and then restarts again.
This should (hopefully) remove the initial pop.
Code: Select all
mergMicrophoneStartRecording test.wav
mergMicrophoneStopRecording
mergMicrophoneStartRecording test.wav
This should (hopefully) remove the initial pop.
Re: recording audio
Your hack works, thanks so much. I wonder why we need to pay a pop tax? Anyway, really helpful to be able to add recording to my app, thanks again.
Re: recording audio
Okay, in a sense, back to square 1, because the mergMicrophone functions only seem to work on MacOS, but not Windows. I'm trying things on Windows 10, and the MergMicrophone functions cause scripts to crash. The standalone builder also crashes on Windows. Are there platform specific microphone (recording) functions for Windows?
-
- Posts: 46
- Joined: Mon Aug 26, 2013 6:49 pm
Re: recording audio
Hi minogaade,
I don’t have a solution for you, but may be an explanation:
I fount some info on: https://bitbucket.org/mgoulding/mergmic ... /wiki/Home
and on:
https://searchcode.com/codesearch/view/45702774/
I am using an iMac 2.93 GHz, 8 GB RAM and OS X 10.11.6. and I don’t have “a ‘tick’ sound at the beginning of my recording”.
I don’t know if an external for Windows 10 does exist.
Hope this helps (a little bit),
Joop
I don’t have a solution for you, but may be an explanation:
I fount some info on: https://bitbucket.org/mgoulding/mergmic ... /wiki/Home
and on:
https://searchcode.com/codesearch/view/45702774/
I am using an iMac 2.93 GHz, 8 GB RAM and OS X 10.11.6. and I don’t have “a ‘tick’ sound at the beginning of my recording”.
I don’t know if an external for Windows 10 does exist.
Hope this helps (a little bit),
Joop
Re: recording audio
Hi, Joop, and apologies for taking so long to reply to your post on my behalf. Yes, I figured out that the MERG record function is designed for iOS -- it works fine in LiveCode running on my Mac, though, but not in a standalone, and inclusion of the MERG functions in Windows does not allow me to even successfully compile Windows standalones, even when I branch the code out of Windows. I’m a professor of linguistics specializing in American Indian languages at the U of Wisconsin-Madison and have been trying to help a fledgling language program we have in the Hoocąk language, by designing an app for them using LiveCode. I’ve had great success in everything except recording, true testimony to the RAD capabilities of LiveCode, since I can only code in my spare time. Hopefully the LiveCode team can figure out a way to give us recording capabilities for MacOS and Windows, it’s a pity we don’t have them, but not the fault of the LC team. I have the utmost respect for them.
I thank you and peachboy, who took the time to reply to my original post, truly a kind gesture on both of your parts.
I thank you and peachboy, who took the time to reply to my original post, truly a kind gesture on both of your parts.