Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audio Example #49

Open
melliiii opened this issue Sep 28, 2023 · 2 comments
Open

Audio Example #49

melliiii opened this issue Sep 28, 2023 · 2 comments

Comments

@melliiii
Copy link

melliiii commented Sep 28, 2023

Heii there,

im trying to run the example you provided in this project but i get this exception:

Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'opus': The specified module could not be found.

	at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:145)
	at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:188)
	at net.tomp2p.opuswrapper.Opus.<clinit>(Opus.java:24)
	at de.affenbande.audio.OpusEncoder.<init>(OpusEncoder.java:68)
	at de.affenbande.audio.OpusEncoder.<init>(OpusEncoder.java:39)
	at de.affenbande.audio.TeamspeakFastMixerSink.openOpusEncoder(TeamspeakFastMixerSink.java:206)
	at de.affenbande.audio.TeamspeakFastMixerSink.start(TeamspeakFastMixerSink.java:255)
	at de.affenbande.audio.MusicPlayer.main(MusicPlayer.java:89)
[mp3 @ 000001ec0e82b400] Skipping 1 bytes of junk at 0.
Input #0, mp3, from '':
  Duration: N/A, start: 0.000000, bitrate: 112 kb/s
    Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 112 kb/s

Process finished with exit code 1

i edited the pom.xml as the hash you put as the version for FFMpeg4j couldnt be found by maven. the latest version didnt take an inputstream as an input for FFmpegInput, only FFmpegIO, but i didnt know how to convert it. So i put in version 4.1-1.4.4

Any help would be appreciated ^^

@melliiii
Copy link
Author

Okay i got about 50 packets to get through after adding System.load("absolute/path/to/lib/opus.dll"), but it stops after the 50 packets and closes.

This is my log:

0.079214 0.04 0
Draining...
Encoder time taken = 30134400 ns
Audio position = 99840 samples sank
Encoder position = 99840 samples encoded
Network position = 12480 bytes sent
Packets encoded = 52 packets encoded
Packets sent = 52 packets sent
Overflow events = 0
Underflow events = 0
[mp3 @ 00000277f103b400] Skipping 1 bytes of junk at 0.
Input #0, mp3, from '':
  Duration: N/A, start: 0.000000, bitrate: 112 kb/s
    Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 112 kb/s

Process finished with exit code 0

@melliiii
Copy link
Author

Ahh there was a break too much in the while loop right at the bottom, i will later add a pull request to fix this later and also show how to add the opus.dll file so that you can actually use the Opus Library ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant