News:

SMF - Just Installed!

Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - AntonioMSR

#1
Hello, Severino Delaurenti

Anyway thank you very much for your attention!  :)
#2
Hello people!  :)

I'm trying to implement in the sample code "Playback of a WASAPI capture device" for VB 6.0 of the Active DJ control \ Studio \ Samples \ VB6 \ WasapiInputPlayer to modify the pitch at the same time that the voice is captured by the microphone, :o but error "ERR_NOT_LOADED_FOR_MIXING -24 Unsupported" is is being shown. The DirectX and VST effects work fine, :-\ but pitch is not working in several attempts made with SetPitch and SetPitchFloat. Is it possible to make it work with Active DJ Studio in any way at the same time that I speak using the microphone? The version of Active DJ Studio is 8.0.0. Can you give me some tips please? Thank you very much!  ;)

Here is the code:

General Declarations

Public tomvoz As Integer


Private Sub Slider1_Change()  ''' CHANGE PITCH
    tomvoz = Slider1.Value
    TextSemitones.Text = tomvoz
    Slider1.Text = tomvoz

  Dim err As enumErrorCodes
  err = Amp3dj1.SetPitch(0, tomvoz)
  If err < 0 Then
    DisplayError err  '''''=> ERR_NOT_LOADED_FOR_MIXING  -24   Unsupported
    Exit Sub
  End If

Amp3dj1.PlaySound 0
End Sub

Private Sub Slider1_Scroll()
    Slider1_Change
End Sub

Private Sub ComboCaptureDevices_Click()
    ' stop the previous capture device
    If Amp3dj1.WASAPI.DeviceIsStarted(m_nCurrCaptureDevice, WASAPI_DEVICE_TYPE_CAPTURE) Then
        Amp3dj1.WASAPI.DeviceStop m_nCurrCaptureDevice, WASAPI_DEVICE_TYPE_CAPTURE, BOOL_TRUE
    End If
   
    ' start the device in shared mode
    Dim nResult As enumErrorCodes
    nResult = Amp3dj1.WASAPI.DeviceStartShared(m_nCurrCaptureDevice, WASAPI_DEVICE_TYPE_CAPTURE, WASAPI_CHANNEL_MODE_STEREO, 0, 0)
    If nResult <> ERR_NOERROR Then
        MsgBox "Device failed to start due to error " & nResult
        Exit Sub
    End If
   
    m_nCurrCaptureDevice = ComboCaptureDevices.ListIndex
   
    ' get the current volume level for the selected device
    Dim fVolume As Single
    Amp3dj1.WASAPI.DeviceVolumeGet 0, WASAPI_DEVICE_TYPE_CAPTURE, SCALE_LINEAR, fVolume
    SliderVolumeCapture.Value = 100 - fVolume
End Sub


Private Sub CommandStartCapture_Click()

    Dim nResult As enumErrorCodes
    nResult = Amp3dj1.WASAPI.AttachInputDeviceToPlayer(0, m_nCurrCaptureDevice, WASAPI_DEVICE_TYPE_CAPTURE)
    If nResult <> ERR_NOERROR Then
        MsgBox "Cannot start playback due to error " & nResult
        Exit Sub
    End If

Amp3dj1.PlaySound 0
End Sub

Private Sub Form_Load()

    ' initialize usage of WASAPI audio drivers
    Dim nReturn As enumErrorCodes
    nReturn = Amp3dj1.InitDriversType(DRIVER_TYPE_WASAPI)
    If nReturn = ERR_INVALID_PLATFORM Then
        MsgBox "This sample can only work on Windows Vista or higher versions. The program will now close."
        End
    End If

    ' verify presence of audio render devices
    Dim nOutputs As Integer
    Amp3dj1.WASAPI.DeviceGetCount WASAPI_DEVICE_TYPE_RENDER, nOutputs
    If nOutputs = 0 Then
        MsgBox "No render device detected and/or connected: the program will now close. Jack-sensing could disable an existing sound card if no speaker is physically connected so, if you are sure that a sound card is installed, try to plug a couple of speakers into the sound card before launching again this program."
        End
    End If
   
    ' verify presence of audio capture devices
    Dim nInputs As Integer
    Amp3dj1.WASAPI.DeviceGetCount WASAPI_DEVICE_TYPE_CAPTURE, nInputs
    If nInputs = 0 Then
        MsgBox "No capture device detected and/or connected: the program will now close. Jack-sensing could disable an existing sound card if no speaker is physically connected so, if you are sure that a sound card is installed, try to plug a microphone into the sound card before launching again this program."
        End
    End If
   
    ' init the DJ control with system default output device
    Amp3dj1.InitDJSystem 1, Me.hwnd, 0, 0, 0, 0

    ' reduce latency using the minimal buffer length (we add 50 ms for safety): in case of stuttering sound,
    ' there could be an issue with the sound card's driver not reporting the correct
    ' minimal allowed buffer length; in order to use this feature, remember to set
    ' the CheckOutputDevicesLatency property to "True" at design-time
    Amp3dj1.BufferLength = Amp3dj1.GetOutputDeviceMinBufferLength(0) + 50

    ' list and start in shared mode the available render devices
    Dim i As Integer
    Dim strDevice As String
    For i = 0 To nOutputs - 1
        strDevice = Amp3dj1.WASAPI.DeviceGetDesc(i, WASAPI_DEVICE_TYPE_RENDER)
        ComboRenderDevices.AddItem strDevice
        Dim nResult As enumErrorCodes
        nResult = Amp3dj1.WASAPI.DeviceStartShared(i, WASAPI_DEVICE_TYPE_RENDER, WASAPI_CHANNEL_MODE_STEREO, 50, 10)
        If nResult <> ERR_NOERROR Then
            Dim strMsg As String
            If nResult = ERR_WASAPI_DEVICE_BUSY Then
                strMsg = "Device " & strDevice & " failed to start because already started in exclusive mode by another process - Do you want to continue?"
            Else
                strMsg = "Device " & strDevice & " failed to start due to error " & nResult & " - Do you want to continue?"
            End If
           
            Dim Response
            Response = MsgBox(strMsg, vbYesNo)
            If Response = vbNo Then
                End
            End If
        End If
    Next i

    ' list the available capture devices
    For i = 0 To nInputs - 1
        strDevice = Amp3dj1.WASAPI.DeviceGetDesc(i, WASAPI_DEVICE_TYPE_CAPTURE)
        ComboCaptureDevices.AddItem strDevice
    Next i
   
    ' select the current system default devices
    ComboRenderDevices.ListIndex = 0
    ComboCaptureDevices.ListIndex = 0
    m_nCurrRenderDevice = ComboRenderDevices.ListIndex
    m_nCurrCaptureDevice = ComboCaptureDevices.ListIndex
   
    ' get the current volume level for the selected playback device
    Dim fVolume As Single
    Amp3dj1.WASAPI.DeviceVolumeGet m_nCurrRenderDevice, WASAPI_DEVICE_TYPE_RENDER, SCALE_LINEAR, fVolume
    SliderVolumePlayer.Value = 100 - fVolume
   
    ' enable generating VU-Meter events passing 0 to the embedded VU meter
    Amp3dj1.VUMeter.Create 0, 0
   
    ' create a fancy VU-Meter
    m_hWndVuMeterLeft = CreateVuMeter(FrameDevices, PictureVuMeterLeft)
    m_hWndVuMeterRight = CreateVuMeter(FrameDevices, PictureVuMeterRight)

    Amp3dj1.EnableMixingFeatures = True

    TextSemitones.Text = 0#

End Sub
#3
Audio editing components / Volume
February 03, 2016, 08:04:00 PM
Hello brilliant programming people! :D

I'm programming with Active Sound Editor and I'm needing of a practical idea, please. I am trying to get the volume in decibels ( dB ) of a sound file when it is loaded on my audio player. After that, I wish can save this sound file with a new value in decibels ( dB) for its volume.
If we can not do this directly , I thought to do as follows: set the new value in decibels ( dB ) and the program would get the equivalent value in percentage (%) and modify the file volume.

To make this, I tried to adapt my intention to part of the sample code in VB6/SoundEditor , specifically the code of "Apply flat volume " option of the menu Effects. And the code of frame frmVolume.frm

To get and set the volume in decibels ( dB ) I also tried using :
OutputVolumeSet method
OutputVolumeGet method

And it's Parameters
fValue
nScaleType
SCALE_LINEAR
0
SCALE_LOG
1

VolumeInDB = 20 * log10 (VolumeLinear/100)
VolumeLinear = 100 * pow (10, VolumeInDB/20);


:-[But in all of my several attempts: What a mess! Can someone please help me?
It will make me happy a lot and who can try to help me I want you to be blessed by this twice happiness!
Thank you very much!
#4
It was a great help ! You're great! Thank you a lot!  ;D
#5
The idea is very good ! I'll try! Thank you a lot!  :D
#6

Hello people! :D

I'm developing an audio player and I'm needing of a practical idea of ​​how to make to that can read and display Synchronized lyrics frames when existing in MP3 files structures through TagsReader.ID3V2_SynchLyricsFrameGet , TagsReader. ID3V2_SynchLyricsFrameInfoGet , TagsReader.ID3V2_SynchLyricsFrameInfoNumGet methods of Active DJ Studio component for VB6.

:-[ I'm breaking my head but I'm not able to put into practice these methods with Active DJ Studio component for VB6 .
Can someone please help me? I will be very grateful for the rest of my life !  ;D
#7
Hello people! :D

I'm developing an audio player and I'm needing of a practical idea ​​how to make to that can read and display file in LRC format existing in the same folder with the same name of an audio file through LrcNotifEnableSet, LrcNotifEnableGet,LrcFileAvailable , LrcIdTagGet , LrcTimeTagsSimpleGetCount , LrcTimeTagsSimpleGetAt , LrcTimeTagsEnhGetCount , LrcTimeTagsEnhGetAt , LrcIdTagGet methods of Active DJ Studio component for VB6.

:-[I'm breaking my head but I'm not able to put into practice these methods with Active DJ Studio component for VB6 .
Can someone please help me? I will be very grateful for the rest of my life !