Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    Nov 2008
    Posts
    39

    help me with audio recording plz

    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 :

    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
    And here is my record button :

    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 ?

  2. #2
    Join Date
    Nov 2008
    Posts
    39
    so.... anyone ?

  3. #3
    Join Date
    Feb 2009
    Posts
    1,285
    If the DLL accepts arguments for the capture function then this may be possible. Although, when a DLL wants arguments for a given function and none were passed during the call it should not work.. so if the call for the capture does work for you I suppose you can't do anything... Where you found the DLL you may look for instructions on how to use it, then you may find something that can help you.
    Last edited by T3STY; 08-02-2010 at 08:12 AM. Reason: grammar errors...

  4. #4
    Join Date
    Nov 2008
    Posts
    39
    I got the DLL from here. No instructions were provided.

  5. #5
    Join Date
    Jun 2007
    Location
    London
    Posts
    700
    I think it would depend on what your computers mixer is set to record. You might benefit from choosing Sterio Mix or Wave in the recording properties. Muting the mic in playback is probably a good idea too.
    I wouldn't mind a copy of that Audio Capture.dll please

  6. #6
    Join Date
    Feb 2009
    Posts
    1,285
    Search the forum for the DLL, you can find it in the AMS 7 forum.

  7. #7
    Join Date
    Jun 2007
    Location
    London
    Posts
    700
    Thanks mate. Got it

  8. #8
    Join Date
    Feb 2008
    Location
    Western Pennsylvania
    Posts
    555
    Hey .:AMS NUB:., Possible you could post that there Drum Machine??

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts