Is it possible to record audio from line in or microphone?

Discuss any general programming issues here
Post Reply
AlexC
Posts: 29
Joined: Sat Mar 09, 2019 2:40 am

Is it possible to record audio from line in or microphone?

Post by AlexC »

Is there a way to capture audio with Hollywood?

I was thinking about making some kind of walkie talkie program to send/receive audio (speech) via TCP or UDP, initially just playing the incoming stream right away, and possibly storing it on the receiving end if the listener is "away" to be able to replay it later, much like an answering machine or voicemail.

I looked at the libraries and plug-ins but couldn't find any function related to the audio input side of things, only playback.

I'm guessing that this feature isn't implemented because it is far less common than audio playback?

I understand that each OS has a different API to access the audio hardware, be it AHI, PulseAudio, Alsa, DirectSound, etc. and since Hollywood is able to play sounds on all the supported platforms it must already support these APIs to some extent.

I also found that SDL can handle audio input but Rebel SDL doesn't seem to have audio input functions. SDL could be a handy shortcut to gaining access to the host OS audio subsystem as the SDL library already supports the related APIs.

Is there currently a way I might have missed?
User avatar
airsoftsoftwair
Posts: 5830
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Is it possible to record audio from line in or microphone?

Post by airsoftsoftwair »

No, it's currently not possible but it's indeed on my list for the next update of the RebelSDL plugin because SDL has this functionality as you've correctly pointed out.
AlexC
Posts: 29
Joined: Sat Mar 09, 2019 2:40 am

Re: Is it possible to record audio from line in or microphone?

Post by AlexC »

Great!
Thank you Andreas!
User avatar
airsoftsoftwair
Posts: 5830
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Is it possible to record audio from line in or microphone?

Post by airsoftsoftwair »

Only took like 13 years or so from the original request but here it finally is, sorry for the delay ;)

Code: Select all

- New: Audio recording is finally supported using the new RecordAudio() function; this function allows you
  to record audio directly to a file in various audio formats (also extensible via plugins); you can also
  configure things like channels, bit depth and sampling frequency in the optional table argument; finally
  asynchronous recording is also supported by setting the "Async" tag to TRUE; note that on slower systems
  like AmigaOS 3 it's recommended to use an output audio format that doesn't use any compression (e.g.
  uncompressed RIFF WAVE) to make sure the file saver can keep up with the audio recorder
Post Reply