Forum > Audio and Video

[SOLVED] Capture sound from line in or microphone

(1/11) > >>

CM630:
I want to capture sound from line in or the microphone and store it in an array.

I came across BASS24 and ACS.
There is a working source with https://sourceforge.net/p/wp-laz/code/HEAD/tree/Oscilloscope/trunk/. It is too complex, there are chances that I can make out how to use it, but I am not sure and it will probably take days.
ACS https://github.com/serbod/acs is updated 4 months ago, but none of its recording examples work.
Could I use something else?

cdbc:
Hi
Sadly, the ACS will take you a long time, to get into working order...
If you're on *nix, I would suggest having a look at @Fred vS' UOS library: https://github.com/fredvs/uos
If you're on winders, I've heard good things about the BASS library: https://www.un4seen.com/
Just my 2 cents worth  :)
Regards Benny

TRon:
User lulu created ALSound which seems simple enough to use, support multiple platforms and all used software is open source.

An simple console recording example can be found here.

Note that you can do without the extra libraries and solely depend on libopenal but then you would have to write some additional code yourself.

Fred vS:
Hello.

--- Quote from: cdbc on June 06, 2024, 09:37:56 am ---If you're on *nix, I would suggest having a look at @Fred vS' UOS library: https://github.com/fredvs/uos

--- End quote ---
uos works for Windows, Linux, FreeBSD and MacOS.
You may take a look at the demo uos/examples/simplerecorder.lpi

[EDIT]: About a oscilloscope code, there is WavvieW, it uses uos.

CM630:

I have tried it.
Writing to WAV works fine.
I have uncommented these lines:




--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---     SetLength(thebuffer, 0);     uos_AddIntoMemoryBuffer(PlayerIndex1, @thebuffer);
but I get no corresponding data in thebuffer, there is a graph with the data, I have exported it to CSV - Excel draws the same curve.



--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---    // saving in a file using a File-Stream:     uos_AddIntoFile(PlayerIndex1, PChar(edit3.Text), -1, -1, -1, 4096, outformat);   //   function uos_AddIntoFile(PlayerIndex: cint32; Filename: PChar; SampleRate: cint32; // Channels: cint32; SampleFormat: cint32 ; FramesCount: cint32 ; FileFormat: cint32): cint32;// Add a Output into audio wav file with custom parameters from TFileStream// PlayerIndex : Index of a existing Player// FileName : filename of saved audio wav file// SampleRate : delault : -1 (44100)// Channels : delault : -1 (2:stereo) (1:mono, 2:stereo, ...)// SampleFormat : default : -1 (2:Int16) (1:Int32, 2:Int16)// FramesCount : default : -1 (= 65536)// FileFormat : default : -1 (wav) (0:wav, 1:pcm, 2:custom, 3:ogg);      //// add Output into wav or ogg file (save record) from TFileStream      // saving in a Memory-Buffer:       SetLength(thebuffer, 0);     uos_AddIntoMemoryBuffer(PlayerIndex1, @thebuffer);            

EDIT: I just saw about WavieW, I will try it.

Navigation

[0] Message Index

[#] Next page

Go to full version