serenity-rs / songbird

An async Rust library for the Discord voice API
ISC License
391 stars 111 forks source link

Getting an invalid opcode when attempting to play audio #220

Closed goddtriffin closed 8 months ago

goddtriffin commented 8 months ago

Songbird version: 0.4.0

Rust version (rustc -V): rustc 1.75.0 (82e1608df 2023-12-21)

Serenity/Twilight version: Serenity 0.12.0

Errors:

2024-01-18T04:08:56.394732Z DEBUG runner{config=Config { crypto_mode: Normal, gateway_timeout: Some(10s), mix_mode: Stereo, preallocated_tracks: 1, driver_retry: Retry { strategy: Backoff(ExponentialBackoff { min: 250ms, max: 10s, jitter: 0.1 }), retry_limit: Some(5) }, use_softclip: true, driver_timeout: Some(10s), disposer: Some(DisposalThread(Sender)), scheduler: None }}: songbird::ws: Unexpected JSON: invalid value: integer `18`, expected opcode in [0--9] + [12--13] at line 1 column 8. Payload: {"op":18,"d":{"user_id":"478651159507107842","flags":2}}
2024-01-18T04:08:56.394778Z DEBUG runner{config=Config { crypto_mode: Normal, gateway_timeout: Some(10s), mix_mode: Stereo, preallocated_tracks: 1, driver_retry: Retry { strategy: Backoff(ExponentialBackoff { min: 250ms, max: 10s, jitter: 0.1 }), retry_limit: Some(5) }, use_softclip: true, driver_timeout: Some(10s), disposer: Some(DisposalThread(Sender)), scheduler: None }}: songbird::ws: Unexpected JSON: invalid value: integer `20`, expected opcode in [0--9] + [12--13] at line 1 column 8. Payload: {"op":20,"d":{"user_id":"478651159507107842","platform":0}}

aka

songbird::ws: Unexpected JSON: invalid value: integer '18', expected opcode in [0--9] + [12--13] at line 1 column 8. Payload: {"op":18,"d":{"user_id":"478651159507107842","flags":2}}

songbird::ws: Unexpected JSON: invalid value: integer '20', expected opcode in [0--9] + [12--13] at line 1 column 8. Payload: {"op":20,"d":{"user_id":"478651159507107842","platform":0}}

FelixMcFelix commented 8 months ago

Assuming this is only a debug message and not a panic, this is fine. We're deliberately not implementing undocumented opcodes because they have changed unexpectedly in the past and caused havoc.

goddtriffin commented 8 months ago

That makes sense - thank you!