record audio

For questions about using Classic.

Post » Wed Feb 02, 2011 8:22 am

I'm developing instruments in Construct, and I need a way to record the audio output of my application - within the application itself

I'd like to be able to use the 'save dialogue' to show where to save the file.

Any ideas?
B
5
G
2
Posts: 40
Reputation: 930

Post » Thu Feb 03, 2011 3:48 am

anyone know?

Someone posted a python script for it in another thread, but I couldn't understand how it worked (I'm not a programmer myself)

If anyone knows how to do it with script, please also explain how to implement the script.

Many thanks!
B
5
G
2
Posts: 40
Reputation: 930

Post » Fri Feb 04, 2011 2:43 am

[quote="birdlantern":hruk2d4s]anyone know?

Someone posted a python script for it in another thread, but I couldn't understand how it worked (I'm not a programmer myself)

If anyone knows how to do it with script, please also explain how to implement the script.

Many thanks![/quote:hruk2d4s]

Hi Birdlantern.. and Chrisrobs previously. I haven't forgotten about this. I tested out the Python code in Construct yesterday and it worked slightly differently than I remember. Instead of recording sound from the PC (internal Audio) it instead recorded from the Mic. This is kinda cool if you are doing a voice recorder program and you might want that feature, but it doesn't do what you wanted.

So I did some searching and found a workaround. You can spawn a program with Construct/Python that creates a virtual bridge between your internal audio device and an external input device so you can record from it using Python like I showed. I'll tinker with it some more this weekend, but I think it will work. After I get that working I'll see if there is not 100% programmatic approach.
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Sun Feb 06, 2011 5:42 am

thanks, I think that's what I'm after...


but to clarify, I'm creating an instrument in Construct - basically I'd like to have a button on the screen, so that when I press it, it records all the sounds that I'm making with the instrument. So what I need is a way for my Contruct application to record itself...

is that possible?


Also - I will be using multiple xaudio objects in my application - and I'd like to be able to record them all simultaneously to a single stereo .wav file...

so that might make it a bit trickier... :)
B
5
G
2
Posts: 40
Reputation: 930

Post » Mon Feb 07, 2011 1:44 am

[quote="birdlantern":2jztkdp1]is that possible?[/quote:2jztkdp1]
Programs like Audacity do it so it is possible with C++. There is a program called "Jack" that allows you to bridge sound from your internal audio device to an external device...and there is a Python interface called Pyjack. It is slightly more complex that I originally thought so I might have to take more time to look at it.

[quote="birdlantern":2jztkdp1]Also - I will be using multiple xaudio objects in my application - and I'd like to be able to record them all simultaneously to a single stereo .wav file...[/quote:2jztkdp1]
I don't think this matters, but wont know until I try it.

If you are eager to test it out now you can bridge your audio out jack w/ your headphone jack and the script I posted should record sound from the Construct program. Obviously this isn't a permanent solution. ;-)
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Tue Feb 08, 2011 8:04 am

Unfortunately I didn't know how to get the original script you posted to work...


but anyway, I'm eager to see what you come up with!

Cheers!
B
5
G
2
Posts: 40
Reputation: 930

Post » Mon Feb 14, 2011 10:01 am

Hi scidave,

any progress on this one? I'm about to finish up some instruments for release, and I'd love to be able to include a record function...

Cheers!

Al
B
5
G
2
Posts: 40
Reputation: 930

Post » Thu Feb 17, 2011 10:39 pm

You need to change some audio properties in windows to be able to record the sound being played. This is not a 100% programming solution but is simple enough for end users to do.

Enable sound recording in Xp:
Control Panel -> Sound and Audio devices
Audio tab -> Sound recording volume
and select "stereo mix" or "wav out"

and in Vista:
[url:asib4u8z]http://downloadsquad.switched.com/2007/01/15/how-to-enable-wave-out-recording-in-vista/[/url:asib4u8z]

Then you can record the sound being played with any sound recording method.
cap:
[url:asib4u8z]http://dl.dropbox.com/u/5426011/examples3/rec.cap[/url:asib4u8z] made in 0.99.96
B
79
S
24
G
54
Posts: 4,746
Reputation: 40,755

Post » Sun Feb 20, 2011 11:00 pm

Thanks rojo - that worked a treat - for anyone else who's interested, that means that using a free program like audacity now works to record the construct application also.

I made a custom recorder in 'Processing' that can launch from my Construct app.

I couldn't get your .cap to work tho - it says 'no module named ctypes'
B
5
G
2
Posts: 40
Reputation: 930

Post » Mon Feb 21, 2011 2:44 pm

Do you have Python installed on your computer? Make sure you check the ctypes.pyc file when exporting the binary. Also, if you want to distribute this to other users (who may not have Python installed) using either ctypes or Pyaudio you will need to export the library using steps shown on quickguide on the Wiki tutorial page.
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests