Hello,
I am trying to convert an mp3 file to a wav file using the Jave2 FFMPeg Library by @Stevel05.
Dependencies are ok but it doesn't work.
Possible to get help. THANKS
Here is the log
Waiting for debugger to connect...
Program started.
Encoding complete false
error Exception : argument type mismatch
and the code
I am trying to convert an mp3 file to a wav file using the Jave2 FFMPeg Library by @Stevel05.
[B4j] Jave2 FFMPeg Library
After using FFMpeg from the command line, I came across Jave2 (Java Audio Video Encoder) a java wrapper based on FFMpeg. Useful to integrate FFMpeg into your app without having to use jShell. The library jars are quite large, so if you only want to use it for the odd conversion it might be...
www.b4x.com
Possible to get help. THANKS
Here is the log
Waiting for debugger to connect...
Program started.
Encoding complete false
error Exception : argument type mismatch
and the code
B4J:
#Region Project Attributes
#MainFormWidth: 600
#MainFormHeight: 600
#End Region
#AdditionalJar: jave/jave-core-3.3.1
#AdditionalJar: jave/jave-nativebin-win64-3.3.1
#AdditionalJar: jave/slf4j-api-2.0.0
#AdditionalJar: jave/slf4j-nop-2.0.0
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private xui As XUI
Private Button1 As B4XView
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("Layout1")
MainForm.Show
Dim SourceFile As String = "D:\test.mp3"
Dim TargetFile As String = "D:\test.wav"
Dim AudioAttrs1 As AudioAttributes
AudioAttrs1.Initialize
AudioAttrs1.SetCodec("pcm_s16le")
Dim MO1 As MultimediaObject
MO1.Initialize
MO1.Create(SourceFile,"")
Dim EncAttrs1 As EncodingAttributes
EncAttrs1.Initialize
EncAttrs1.SetOutputFormat("wav")
EncAttrs1.SetAudioAttributes(AudioAttrs1)
'
Dim Enc1 As Encoder
Enc1.Initialize(Me,"Enc")
Enc1.Encode3(MO1,TargetFile,"",EncAttrs1)
Try
Wait For Enc_Complete(EndedOK As Boolean, Error As String)
Log("Encoding complete " & EndedOK)
Log("error "& Error)
Catch
Log("Encoding failed " & LastException)
End Try
End Sub
Private Sub Enc_Event(MethodName As String,Args() As Object)
Select MethodName
Case "message"
Log("Message " & Args(0))
Case "progress"
Log("Progress " & Args(0))
Case "sourceinfo"
Log("Source Info " & Args(0))
End Select
End Sub