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 - Terry

#1
Hi,

After replacing the program, the issue no longer occurs. Thank you. However, I have discovered another problem that existed even before the update.

When using "CastingCreateFromStreamMixer" to generate encoded streams and connect to the same or different "Icecast Servers" with different MountPoint Names, only the last MountPoint remains on the "Icecast server", and all others disappear. I slightly modified the WasapiMixAndClone sample program as follows:

For i = 0 To 3
    Dim mp As String = frmShoutcast.TextMountName.Text.Trim & "." & i.ToString

    ' create and intialize casting
    m_nCastingUniqueID = m_audioDjAPI.CastingCreateFromStreamMixer(m_nStreamMixerUniqueID, frmShoutcast.TextServerAddress.Text, frmShoutcast.TextPwd.Text, mp, nFormat, frmShoutcast.TextStreamName.Text, frmShoutcast.TextUrl.Text, frmShoutcast.TextGenre.Text, "", frmShoutcast.TextDescription.Text, nEncodeMode, fEncodeValue, 44100, 2)

    ' check if casting was intialized correctly
    If m_nCastingUniqueID = 0 Then
       CheckConnection.Checked = False
       CheckConnection.Text = "Connect"
       MessageBox.Show("Cannot create casting due to the following error " & m_audioDjAPI.LastError.ToString())
       Return
    End If
    .
    .
    .same codes
    . 
    .
 Next

When connect to Icecast, each MountPoint can be seen on the Icecast2 Status management webpage. However, when trying to listen by entering the URL, a '404 - The file you requested could not be found' error appears, and then the MountPoint disappears from the Icecast2 Status management webpage.

This phenomenon only occurs with CastingCreateFromStreamMixer, but not with CastingCreateFromPlayer."

Any idea?

Terry
#2
Hi,

I have replaced AdjMmsEng64.dll and AdjMmsEng.dll(ver. 14.4.5.2), but the connection shows an 'ERR_ENCODER_NOT_AVAILABLE' error message. Reverting to the previous version (ver. 14.4.5.1) works fine. All sample programs related to casting show the same error.

Terry
Thank you.
#3
Hi,

I have already adjusted it to 96 K, but the situation remains the same.

Terry
#4
Hi,

I found that the streaming audio sent from CastingCreateFromStreamMixer becomes faster and choppy. You can listen to http://220.135.102.142:8010/q, which is sent through the sample program WasapiMixAndClone.exe. And http://220.135.102.142:8010/test is sent by another program and is relatively normal. You can compare the two. Both audio sources are from the same input device.

Terry
Thank you.
#5
Hi,

After replacing the multimedia engine library, the program no longer experiences sudden interruptions. However, if I perform a stress test by continuously pressing the [Load] button, the program becomes unresponsive. This issue can be resolved through programming.

I will continue testing and will report any other issues. Thank you.

Terry
#6
Hi,

When the connection and playback are normal, it usually triggers enumPlayerEvents.EV_STREAM_CONNECTING and then continues with the callback. However, when the program crashes, after triggering enumPlayerEvents.EV_STREAM_CONNECTING, the program stops responding and does not proceed to the callback. It crashed immediately after not responding for a few seconds, preventing the call stack from being checked.




Hope this information helps.

Thank you.
Terry


#7
Hi,

http://220.135.102.142:8010/test

Sometimes it can connect and stream, sometimes it can't, and usually it suddenly crashes immediately. Please try several times.

Thank you.
Terry


#8
Hi,

I want to add that the Icecast server the program connects to does not use a playlist or mp3 file for streaming, but rather a stream similar to the following URL: http://ipaddress:8000/test

Thank you.
Terry
#9
Hi,

I used your sample program InternetRadio.exe to connect to a streaming server set up with Icecast2 and with a connection limit.

Connections and playback are normal within the connection limit, but if the program connects under the condition of being the last available connection, it usually sometimes connects and sometimes doesn't. More often, the program crashes immediately without any error message, leaving an Application Error 1000 kernelbase.dll error record in the Windows Event Viewer.

Is there a way to solve this?

Thank you.
Terry
#10
Hi,

There are two ways to send an audio stream to a streaming server. The sample project is one of them.
But it still needs to be attached to a Player and then output.
Is there any way to capture only the input audio source but not play output?

There is one more thing that I am confused about the WasapiMixAndClone sample project.
Why a control can initial more than 4 players? The three extra Players in the sample program seem to have no effect.

// init the DJ Studio control by instancing an adequate number of players:
// 2 for playing sound files from disk and 5 for attaching input devices
short nPlayers = 2 + 5;
nPlayers = m_audioDjAPI.InitSoundSystem(nPlayers, m_nWasapiDevice, m_nWasapiDevice, m_nWasapiDevice, 0);

Terry
Thank you
#11
Hi,

Is there any way to send an input audio device stream to a streaming server?

Terry
Thank you.
#12
Hi,

I tried to load a sound file from the website through the "m_audioAPI.LoadInternetStream(0,"http://localhost/test.mp3")" command.
When the playback is completed, the EV_DOWNLOAD_COMPLETE event will be triggered first, and then the EV_SOUND_DONE event will be triggered infinitely.

The execution logs is as follows

13:10:30.0695|[1]|[EV_SOUND_STOPPED]
13:10:30.1013|[1]|[EV_STREAM_CONNECTING]
13:10:30.3553|[1]|[EV_DOWNLOAD_BUFFERING] URL=http://localhost/test.mp3 STREAMING_BUFFERING
13:10:30.3678|[1]|[EV_STREAM_LOADED] STREAM_LOAD_OK http://localhost/test.mp3
13:10:30.3678|[1]|[EV_SOUND_PLAYING] URL=http://localhost/test.mp3
13:10:30.3678|[1]|[EV_DOWNLOAD_BUFFERING] URL=http://localhost/test.mp3 STREAMING_PLAYING
13:11:18.3746|[1]|[EV_DOWNLOAD_COMPLETE] URL=http://localhost/test.mp3
13:11:24.2355|[1]|[EV_SOUND_DONE] URL=http://localhost/test.mp3
13:11:24.2524|[1]|[EV_SOUND_DONE] URL=http://localhost/test.mp3
13:11:24.2685|[1]|[EV_SOUND_DONE] URL=http://localhost/test.mp3
13:11:24.2854|[1]|[EV_SOUND_DONE] URL=http://localhost/test.mp3
13:11:24.2854|[1]|[EV_SOUND_STOPPED] URL=http://localhost/test.mp3
13:11:24.2854|[1]|[EV_SOUND_DONE] URL=http://localhost/test.mp3
13:11:24.3026|[1]|[EV_SOUND_DONE] URL=http://localhost/test.mp3
13:11:24.3186|[1]|[EV_SOUND_DONE] URL=http://localhost/test.mp3
.
.
infinite loop


Is it normal ....?

Terry
#13
Hi,

Executing the 'PlayListStop' command will not trigger any events, right?

Kind Regards

Terry
#14
I was so careless, thank you.
#15
Hi,

I discovered that the AudioDjStudioApi cannot play audio files in a playlist within a command line program.
I modified the sample program "PlayerCmdLine" so that the program can load a directory containing audio source files and play them, but it seems to be unsuccessful. It can load a single audio file and play but a playlist. The program code is as follows. Is there anything I'm missing?



'---------------------------------------------------------------
Namespace PlayerCmdLine
   Friend Class Program
      Private Shared m_bSoundDone As Boolean = False
        Private Shared m_strInputPathname As String = ""
        Private Shared addrCallbackForPlayersEvents As CallbackForPlayersEvents = New CallbackForPlayersEvents(AddressOf PlayerCallback)
        Private Shared m_audioAPI As AudioDjStudioApi.AudioDjStudioApiObj = New AudioDjStudioApi.AudioDjStudioApiObj()


      Private Shared Sub PlayerCallback(ByVal nEvent As enumPlayerEvents, ByVal nPlayer As Int16, ByVal nData1 As Int32, ByVal nData2 As Int32, ByVal fData3 As Single, ByVal pBufferUnicode As IntPtr, ByVal nBufferLength As Int32)
         Select Case nEvent
            Case enumPlayerEvents.EV_SOUND_DONE
                    Console.WriteLine(Constants.vbCr & nEvent.ToString)
                    m_bSoundDone = True

                Case enumPlayerEvents.EV_SOUND_PLAYING
                    Console.WriteLine(Constants.vbCr & "Status: Sound playing...")

                Case enumPlayerEvents.EV_PLAYLIST_LOAD_DONE
                    Console.WriteLine(Constants.vbCr & nEvent.ToString)
                    If nData1 = 0 Then
                        Console.WriteLine(Constants.vbCr & "Error loading playlist")
                    End If
                Case enumPlayerEvents.EV_PLAYLIST_DONE
                    Console.WriteLine(Constants.vbCr & nEvent.ToString)

                Case enumPlayerEvents.EV_PLAYLIST_LOAD_STARTED
                    Console.WriteLine(Constants.vbCr & nEvent.ToString)

                Case Else
               Return
         End Select
      End Sub

      Shared Sub Main(ByVal args As String())
         If args Is Nothing Then
                Console.WriteLine("args is null") ' Check for null array
                Return
            End If
            ' read command line arguments
            Dim prefixes As String() = New String() {"/i:"}
            Dim cae As CmdArgExtractor = New CmdArgExtractor(prefixes, "/"c, ":"c)

            If (Not cae.ValidArgsPrefixes(args)) Then
                Return
            End If

            Dim my2dArr As String(,) = cae.GetArgsTwoDimArray(args)
            Dim i As Integer = 0
            Do While i < my2dArr.GetLength(1)
                Select Case my2dArr(0, i)
                    Case "i"
                        m_strInputPathname = my2dArr(1, i)
                End Select
                i += 1
            Loop
            Console.Clear()
            m_audioAPI.InitSoundSystem(1, 0, 0, 0, 0)
            m_audioAPI.CallbackForPlayersEventsSet(addrCallbackForPlayersEvents)
            m_audioAPI.DisplayVUMeter.Create(0, IntPtr.Zero)
            m_audioAPI.StreamVolumeLevelSet(0, 100, enumVolumeScales.SCALE_LINEAR)
            Dim err As enumErrorCodes
            Select Case True
                Case Directory.Exists(m_strInputPathname)
                    For Each file As String In Directory.GetFiles(m_strInputPathname)
                        err = m_audioAPI.PlayListAddItem(0, m_strInputPathname, 0)
                        Console.WriteLine("{0} {1}", file, err.ToString)
                    Next
                    Console.WriteLine(m_audioAPI.PlayListExecute(0, True).ToString)

                Case File.Exists(m_strInputPathname)
                    err = m_audioAPI.LoadSound(0, m_strInputPathname)
                    Console.WriteLine("{0} {1}", m_strInputPathname, err.ToString)
                    Console.WriteLine(m_audioAPI.PlaySound(0).ToString)

            End Select

            If m_audioAPI.LastError <> enumErrorCodes.ERR_NOERROR Then
                Console.WriteLine("Cannot load file due to error " & m_audioAPI.LastError.ToString)
            Else
                Dim info As ConsoleKeyInfo = New ConsoleKeyInfo()
                Do While Not Console.KeyAvailable
                    If m_bSoundDone Then
                        Exit Do
                    End If
                    Thread.Sleep(50)
                Loop
                m_audioAPI.StopSound(0)
                Console.WriteLine(Constants.vbCrLf & "Status: Stop")
            End If

            m_audioAPI.Dispose()
        End Sub
    End Class
End Namespace

'---------------------------------------------------------------

Terry