hey guys i am working on a drum machine. So far it works flawlessly. But when it records I use the audiorecord.dll i found on this site and it works fine, BUT it only records open air, like thru the microphone. How do i set the properties to point to specific channels in the AMS8 app that I want to record ?
i am using AMS 8 with AudioCapture.dll
here are my globals :
And here is my record button :Code:function StringToTable(string) index1 = String.Find(string, ",", 1, false); index2 = String.Find(string, ",", index1 + 1, false); audioSettings = {}; audioSettings.Channels = String.Left(string, index1 - 1); audioSettings.SamplesPerSec = String.Mid(string, index1 + 1, index2 - index1 - 1); audioSettings.BitsPerSample = String.Right(string, String.Length(string) - index2); return audioSettings; end --Audio capture quality settings. AudioCaptureQuality = {}; --channels=1, samplesPerSec=11025, bitsPerSample=8); AudioCaptureQuality.Low = 0; --channels=2, samplesPerSec=22050, bitsPerSample=16); AudioCaptureQuality.Medium = 1; --channels=2, samplesPerSec=44100, bitsPerSample=16); AudioCaptureQuality.High = 2; AudioCapture = {}; --Gets audio capture quality. function AudioCapture.GetQuality() return DLL.CallFunction("AutoPlay\\Docs\\AudioCapture.dll", "GetQuality", "", DLL_RETURN_TYPE_STRING, DLL_CALL_STDCALL); end --Gets audio capture settings. [channels = 1 (mono), 2 (stereo); samplesPerSec = 8000 (hz), 11025 (hz), 22050 (hz), 44100 (hz); bitsPerSample = 8, 16;] function AudioCapture.GetSettings() settings = DLL.CallFunction("AutoPlay\\Docs\\AudioCapture.dll", "GetSettings", "", DLL_RETURN_TYPE_STRING, DLL_CALL_STDCALL); return StringToTable(settings); end --Gets audio capture mode status. function AudioCapture.GetStatus() return DLL.CallFunction("AutoPlay\\Docs\\AudioCapture.dll", "GetStatus", "", DLL_RETURN_TYPE_STRING, DLL_CALL_STDCALL); end --Sets audio capture quality. function AudioCapture.SetQuality(quality) DLL.CallFunction("AutoPlay\\Docs\\AudioCapture.dll", "SetQuality", quality, DLL_RETURN_TYPE_LONG, DLL_CALL_CDECL); end --Sets audio capture settings. [channels = 1 (mono), 2 (stereo); samplesPerSec = 8000 (hz), 11025 (hz), 22050 (hz), 44100 (hz); bitsPerSample = 8, 16;] function AudioCapture.SetSettings(channels, samplesPerSec, bitsPerSample) DLL.CallFunction("AutoPlay\\Docs\\AudioCapture.dll", "SetSettings", channels..","..samplesPerSec..","..bitsPerSample, DLL_RETURN_TYPE_LONG, DLL_CALL_CDECL); end --Sets audio capture time position in milliseconds. function AudioCapture.SetPosition(position) DLL.CallFunction("AutoPlay\\Docs\\AudioCapture.dll", "SetPosition", position, DLL_RETURN_TYPE_LONG, DLL_CALL_CDECL); end --Start audio capture. function AudioCapture.CaptureStart() DLL.CallFunction("AutoPlay\\Docs\\AudioCapture.dll", "CaptureStart", "", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL); end --Stop audio capture. function AudioCapture.CaptureStop() DLL.CallFunction("AutoPlay\\Docs\\AudioCapture.dll", "CaptureStop", "", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL); end --Start playing captured audio. function AudioCapture.PlayStart() DLL.CallFunction("AutoPlay\\Docs\\AudioCapture.dll", "PlayStart", "", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL); end --Stop playing captured audio. function AudioCapture.PlayStop() DLL.CallFunction("AutoPlay\\Docs\\AudioCapture.dll", "PlayStop", "", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL); end --Save captured audio. function AudioCapture.Save(fileName) DLL.CallFunction("AutoPlay\\Docs\\AudioCapture.dll", "Save", "\""..fileName.."\"", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL); end --Clear captured audio. function AudioCapture.Clear() DLL.CallFunction("AutoPlay\\Docs\\AudioCapture.dll", "Clear", "", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL); end --Get error if any occur. function AudioCapture.GetError() return DLL.CallFunction("AutoPlay\\Docs\\AudioCapture.dll", "GetError", "", DLL_RETURN_TYPE_STRING, DLL_CALL_STDCALL); end
Code:AudioCapture.SetQuality(AudioCaptureQuality.High); AudioCapture.CaptureStart(); x = Slider.GetSliderPos("speed"); timer =0 timer2 = 100 timer3 = 200 timer4 = 300 while (timer < 17) do sound = Button.GetState("Button"..timer..""); sound2 = Button.GetState("Button"..timer2..""); sound3 = Button.GetState("Button"..timer3..""); sound4 = Button.GetState("Button"..timer4..""); Image.SetVisible("Image"..timer.."", true); if sound == 1 then Audio.Load(CHANNEL_USER1, "AutoPlay\\Audio\\01 Kick 12.wav", true, false); end if sound2 == 1 then Audio.Load(CHANNEL_USER2, "AutoPlay\\Audio\\01 Tight Hi Hat 02.wav", true, false); end if sound3 == 1 then Audio.Load(CHANNEL_USER3, "AutoPlay\\Audio\\01 Snare 02.wav", true, false); end if sound4 == 1 then Audio.Load(CHANNEL_USER4, "AutoPlay\\Audio\\05 Conga 02.wav", true, false); end Application.Sleep(x); Image.SetVisible("Image"..timer.."", false); timer = timer + 1; timer2 = timer2 + 1; timer3 = timer3 + 1; timer4 = timer4 + 1; end AudioCapture.CaptureStop(); fileName = Dialog.FileBrowse(false, "Locate File", _DesktopFolder, "Wav File (*.wav)|*.wav|", "", "wav", false, false)[1]; if (fileName ~= "CANCEL") then AudioCapture.Save(fileName); end
I have many channels and buttons on my app that a user may use when making the beats, I need to get this DLL to grab the audio from channels USER_1, USER_2, USER_3 and USER_4.
Is this possible ?

Reply With Quote
