toniebox-reverse-engineering / teddy

With this tool you can dump existing files for the famous audio box or create custom ones.
261 stars 33 forks source link

Teddy.exe (version 1.20) fails to read mp3 files - MacOS 12.6 #58

Closed steve8x8 closed 1 year ago

steve8x8 commented 1 year ago

Using Teddy on MacOS, I seem to be unable to read mp3 files for encoding (both in VBR and CBR modes):

mono ../Teddy.exe -m encode --vbr -v -v -v -o NEW.20230121T140455 test.mp3
[Mode: encode, 96 kbps, VBR]
 Track   1 - test.mp3         [

[ERROR] Failed to process
   Exception:  System.Exception
   Message:    Failed processing test.mp3
   Stacktrace:   at TonieFile.TonieAudio.GenerateAudio (System.Collections.Generic.List`1[T] sourceFiles, System.UInt32 audioId, System.Int32 bitRate, System.Boolean useVbr, System.String prefixLocation) [0x00450] in <7eb3521780ee44579babbcaa2588b834>:0 
  at TonieFile.TonieAudio.BuildFromFiles (System.Collections.Generic.List`1[T] sourceFiles, System.UInt32 audioId, System.Int32 bitRate, System.Boolean useVbr, System.String prefixLocation) [0x00000] in <7eb3521780ee44579babbcaa2588b834>:0 
  at TonieFile.TonieAudio..ctor (System.String[] sources, System.UInt32 audioId, System.Int32 bitRate, System.Boolean useVbr, System.String prefixLocation) [0x00046] in <7eb3521780ee44579babbcaa2588b834>:0 
  at Teddy.Program.Main (System.String[] args) [0x00e97] in <7eb3521780ee44579babbcaa2588b834>:0 
[Mode: encode, 96 kbps, CBR]
 Track   1 - test.mp3         [

[ERROR] Failed to process
   Exception:  System.Exception
   Message:    Failed processing test.mp3
   Stacktrace:   at TonieFile.TonieAudio.GenerateAudio (System.Collections.Generic.List`1[T] sourceFiles, System.UInt32 audioId, System.Int32 bitRate, System.Boolean useVbr, System.String prefixLocation) [0x00450] in <7eb3521780ee44579babbcaa2588b834>:0 
  at TonieFile.TonieAudio.BuildFromFiles (System.Collections.Generic.List`1[T] sourceFiles, System.UInt32 audioId, System.Int32 bitRate, System.Boolean useVbr, System.String prefixLocation) [0x00000] in <7eb3521780ee44579babbcaa2588b834>:0 
  at TonieFile.TonieAudio..ctor (System.String[] sources, System.UInt32 audioId, System.Int32 bitRate, System.Boolean useVbr, System.String prefixLocation) [0x00046] in <7eb3521780ee44579babbcaa2588b834>:0 
  at Teddy.Program.Main (System.String[] args) [0x00e97] in <7eb3521780ee44579babbcaa2588b834>:0 

Unfortunately I currently cannot use TeddyBench. Any hints how to further debug this (beyond -v -v -v)? Thanks in advance...

SciLor commented 1 year ago

This because TeddyBench uses windows specific features to encode the files. Please use the Linux fork, that uses ffmpeg for encoding.

steve8x8 commented 1 year ago

Still getting errors (which seem to be related to the GUI, this is MacOS not Windows and not Linux) - and there seems to be no plain Teddy.exe in @AlbrechtL 's releases. I'll attempt to setup a Linux VM.

SciLor commented 1 year ago

I would rather try using a Windows VM, as this is the most used version.

steve8x8 commented 1 year ago

Got a bit further (I won't touch Windows, I swear!), by adding a few settings:

export MONO_FRAMEWORK=/opt/homebrew # I'm using brew for everything missing from the OS, including `mono`
export DYLD_FALLBACK_LIBRARY_PATH=${LD_LIBRARY_PATH} # as mono doesn't seem to obey `LD_LIBRARY_PATH`

(LD_LIBRARY_PATH contains /opt/homebrew/lib) to the TeddyBench script, and installed mono-libgdiplus which was indeed missing. Now TeddyBench tells me

Unhandled Exception:
System.TypeInitializationException: The type initializer for 'System.Windows.Forms.XplatUI' threw an exception. ---> System.DllNotFoundException: libc.dylib assembly:<unknown assembly> type:<unknown type> member:(null)

(the GDIplus error is gone!). I'm now open for suggestions where to find (or how to add) libc.dylib. (Next I'll try export MONO_LOG_LEVEL=debug.)

steve8x8 commented 1 year ago

All attempts to get TB working on Mac have failed, and I'm running out of time and ideas - switching to bailli/opus2tonie which is a pure Python solution, and looks perfect for command-line usage ... I'll watch out for new releases though.