Consulting

Results 1 to 1 of 1

Thread: Looking for help with MCI API sound recording / recording sound with VBA

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Newbie
    Joined
    Apr 2018
    Posts
    1
    Location

    Question Looking for help with MCI API sound recording / recording sound with VBA

    Hello coders!

    I have a problem - and it is probably due to using MCI API tool as a recorder. Let me explain you what I want to achive and where the issue is.

    MY AIM:
    My idea was to make an application for myself which would help me learning and reminding foreign languages. I have created a database in a worksheet that contains words devided into columns. First columns contains polish words, second english and last one is filled with german (see attached image of structutre). I have already made the code that reads the text from column to column, goes down in row and repeats whole the procedure as many times as I wish to. I have also managed to write the code that uses MCI API to record all the text that was read (that was my main aim, because I want to create sound files and remind language when commuting work etc.). Everything work perfectly fine, but...
    worksheetstructure.JPG

    PROBLEM:
    The problem is in a quality of recording itself. When I play it I can hear a noise in the background, buzzing. It is conspicuous enought to unable comfortale listening and learning. (check the attachment for .wav sample file).

    CODE:
    Function Recording()
    Dim MciMsgOpen As Integer
    Dim MciMsgRec As Integer
    MciMsgOpen = mciSendString("open new Type waveaudio alias Rec1", "", 0, 0)
    MciMsgRec = mciSendString("record Rec1", "", 0, 0)
    End Function
    
    Function Saving()
    Dim MciMsgStop As Integer
    Dim MciMsgSave As Integer
    Dim MciMsgClose As Integer
    MciMsgStop = mciSendString("stop Rec1", "", 0, 0)
    MciMsgSave = mciSendString("save Rec1 c:\Audio.wav", "", 0, 0)
    MciMsgClose = mciSendString("close Rec1", "", 0, 0)
     End Function
    CHECKED:
    Firstly I was almost sure that it is due to STEREO MIX I'm using as a microphone to record output sounds. Nevetheless I have also tried to record sounds from another application (simple recorder which is installed on every Windows) and the sound was perfectly pure. That is why I think the problem is with MCI API itself but I may be wrong.

    HELP:
    I would be very greatful if somebody found the solution. I have already spend many hours with no effect at all. Any hint or tip where to start finding the solution would be a huge help.

    SOLUTION:
    Unknow.

    Thank you very much for your time.
    Michał
    Attached Files Attached Files
    Last edited by Aussiebear; 04-12-2023 at 06:41 PM. Reason: Reduced the whitespace

Tags for this Thread

Posting Permissions

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