Results 1 to 3 of 3

Thread: Audio buffers

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 1999
    Location
    Amman,-,Jordan
    Posts
    3

    Post

    How can I write directly to audio device output buffer, or the speaker of it, and how can read the microphone input directly from it's buffer, is there any API function to do that?

  2. #2

  3. #3
    Megatron
    Guest
    To read from a microphone, you could use the mciSendString API.
    VB Code:
    1. Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As Any, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
    2.                                        
    3. Private Sub cmdRecord_Click()
    4.  
    5.     'Open a WaveAudio called Record
    6.     mciSendString "open new type waveaudio Alias record", 0&, 0, 0
    7.     'Start Recording
    8.     mciSendString "record record", 0&, 0, 0
    9.    
    10. End Sub
    11.  
    12. Private Sub cmdSave_Click()
    13.  
    14.     'Stops recording
    15.     mciSendString "stop record", 0&, 0, 0
    16.     'Saves the sound
    17.     mciSendString "save record C:\Windows\Desktop\MyWav.wav", 0&, 0, 0
    18.     'Close "Record"
    19.     mciSendString "close record", 0&, 0, 0
    20.                                        
    21. End Sub

Posting Permissions

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



Click Here to Expand Forum to Full Width