You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Edge Engine actually synthesizes MP3 files, not WAV. That might explain the issue you're seeing.
Here’s a quick example that works perfectly for me using RealtimeTTS:
if__name__=="__main__":
fromRealtimeTTSimportTextToAudioStream, EdgeEngineimportosdefdummy_generator():
yield"Hey guys! These here are realtime spoken sentences based on local text synthesis. "yield"With a local, neuronal, cloned voice. So every spoken sentence sounds unique."print("Starting engines")
edge_engine=EdgeEngine()
stream=TextToAudioStream(edge_engine)
stream.feed(dummy_generator())
stream.play(output_wavfile=stream.engine.engine_name+"_output.mp3")
The MP3 file gets generated without any errors on my end, and it plays back exactly as expected. Could it be that you're trying to process an MP3 as if it’s a WAV file? That would explain why Unity throws the frequency error and why some apps fail to open the file.
I'm trying to import the audio file generated into unity.
This works with every engine I've tried so far perfectly (SystemEngine, CoquiEngine, GTTSEngine)
But with the Edge engine I'll get this error:
ArgumentException: Frequency in created clip must be greater than 0 UnityEngine.AudioClip.Create (System.String name, System.Int32 lengthSamples, System.Int32 channels, System.Int32 frequency, System.Boolean stream, UnityEngine.AudioClip+PCMReaderCallback pcmreadercallback, UnityEngine.AudioClip+PCMSetPositionCallback pcmsetpositioncallback) (at <c08eccfa13ce4e9da1b670057c106561>:0) UnityEngine.AudioClip.Create (System.String name, System.Int32 lengthSamples, System.Int32 channels, System.Int32 frequency, System.Boolean stream) (at <c08eccfa13ce4e9da1b670057c106561>:0) WavUtility.ToAudioClip (System.Byte[] wavData) (at Assets/Scripts/WavUtility.cs:37) AudioPlayer.LoadAudioClip (System.String path) (at Assets/Scripts/AudioFileMonitor.cs:101) AudioPlayer+<PlayAudioFiles>d__5.MoveNext () (at Assets/Scripts/AudioFileMonitor.cs:50) UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <44f3679c53d1477a9c6e72f269e3a3a9>:0)
Also I cannot open the wav file with some applications.
Does anyone know a fix? Thanks in advance.
The text was updated successfully, but these errors were encountered: