Microphone inputs for Windows.

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
Drachen Jager
Posts: 20
Joined: Tue Aug 28, 2007 9:23 pm

Microphone inputs for Windows.

Post by Drachen Jager » Wed Aug 29, 2007 6:34 pm

I want to create a program where the user can speak into a microphone and the sound is played back for him. Simple right?

I have the basic thing working, I hit my record button and then play and I hear the "pop" of the playback starting but no audio, I've tried saving it to a file and the file saves fine but it's an empty audio file.

So, I figured I have my microphone input wrong, I tried every input in Revolution imic, emic, cd, (with 2 spaces after and the computer's cd player running) irca, tvfm, idav, mbay, modm and zvpc. EVERY one of them fails to record anything (no pop, no file recorded). I made a program to tell me what the sound input is before I meddled and it said "dflt" which I presume is the computer default device, I set my microphone up as the default device and still just a click and an empty file.

I am trying to use a USB mic but would settle for just about anything that worked. OS is Win XP 64 but I want to create a program that will work on all recent Windows platforms.

Any help would be greatly appreciated.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10043
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Post by FourthWorld » Wed Aug 29, 2007 7:21 pm

I believe the sound recording API relies on QuickTime. Do you have QT installed on that system?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Drachen Jager
Posts: 20
Joined: Tue Aug 28, 2007 9:23 pm

Post by Drachen Jager » Wed Aug 29, 2007 8:50 pm

Yes, latest QT, it works fine for playback, and like I said it seems to record OK, it just isn't recording from the right input.

Drachen Jager
Posts: 20
Joined: Tue Aug 28, 2007 9:23 pm

Post by Drachen Jager » Tue Sep 04, 2007 8:01 pm

I did some poking around and, correct me if I'm wrong but don't newer versions of QT only allow sound recording in QT Pro?

I cannot expect my customers to have Pro so are there any workarounds? Can someone point me in the right direction for a windows soundrecorder plugin for Revolution?

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Tue Sep 04, 2007 9:44 pm

Hi Drachen Jager,

Installing QT is sufficient to enable recording in Revolution. There is no need for QT Pro. Is it possible that your USB mic or the driver or some other software is the culprit? Or could the problem be that you are using Revolution on a 64 bit machine (Rev bug)? Have you tried a different microphone, quitting or even uninstalling any software that might hijack sound input, and recording with the same microphone on a different machine? What else have you tried exactly?

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Drachen Jager
Posts: 20
Joined: Tue Aug 28, 2007 9:23 pm

Post by Drachen Jager » Tue Sep 04, 2007 9:48 pm

I just figured it out, I copied and pasted and paraphrased this string from the video player tutorial.

repeat while recordaudio is true
-- give processor time
revAudioGrabIdle
-- allow other processes the chance to run
-- needed to allow the user to click "stop preview"
-- which will set the recordVideo handler to false
-- and thus exit this repeat loop
wait for 1 millisecond with messages
end repeat

Apparently something else was blocking QT's access to the processor? Do I have that right? And this line forces RR to allocate free run time to recording audio.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Tue Sep 04, 2007 10:33 pm

Dear Drachen Jager,

OK, all clear now. This doesn't work:

Code: Select all

on recordSound theFile
  record sound file theFile
  wait 100 -- or a repeat loop or anything that keeps running this script
  stop recording
end recordSound
But this works:

Code: Select all

on recordSound theFile
  record sound file theFIle
end recordSound
and in a button:

Code: Select all

on mouseUp
  stop recording
end mouseUp
Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Drachen Jager
Posts: 20
Joined: Tue Aug 28, 2007 9:23 pm

Post by Drachen Jager » Tue Feb 19, 2008 12:17 am

Ok, it WAS working, I've been programming other areas and was just recently doing some alpha testing, now sound recording doesn't work again!

I tested older versions of my program where audio recording worked and it fails there too so it's something external which has changed.

Either it's because I'm running a newer version of Quicktime now or some other update on my machine as far as I can determine.

Drachen Jager
Posts: 20
Joined: Tue Aug 28, 2007 9:23 pm

Post by Drachen Jager » Thu Apr 24, 2008 10:57 pm

Works properly in 2.9

(now if I could just get the player to switch files properly in 2.9!)

edelen
Posts: 2
Joined: Fri Oct 22, 2010 11:14 pm

Re: Microphone inputs for Windows.

Post by edelen » Fri Oct 22, 2010 11:16 pm

I am trying to make a program that record my sound on Windows 7. I could not make it create a file? Does any one has any idea?

WaltBrown
Posts: 466
Joined: Mon May 11, 2009 9:12 pm

Re: Microphone inputs for Windows.

Post by WaltBrown » Sat Oct 23, 2010 5:08 am

I made this up when I read this thread. I am running Vista x64, and do NOT have QT installed. Note that I have playStarted and playStopped handlers and only the playStopped message triggers.
Walt
Attachments
SoundRecordingTest.zip
(781 Bytes) Downloaded 406 times
Walt Brown
Omnis traductor traditor

Post Reply