Add librespot.audio.decoders
This commit is contained in:
parent
60adbd8beb
commit
8d86accf48
12
README.md
12
README.md
|
@ -36,18 +36,20 @@ aceess_token = session.tokens().get("playlist-read")
|
|||
```
|
||||
### Get Music Stream
|
||||
\*Currently, music streaming is supported, but it may cause unintended behavior.
|
||||
|
||||
```python
|
||||
from librespot.core import Session
|
||||
from librespot.metadata import TrackId
|
||||
from librespot.player.codecs import AudioQuality, VorbisOnlyAudioQuality
|
||||
from librespot.player.codecs import VorbisOnlyAudioQuality
|
||||
from librespot.audio.decoders import AudioQuality
|
||||
|
||||
|
||||
session = Session.Builder() \
|
||||
.user_pass("Username", "Password") \
|
||||
session = Session.Builder()
|
||||
.user_pass("Username", "Password")
|
||||
.create()
|
||||
|
||||
track_id = TrackId.from_uri("spotify:track:xxxxxxxxxxxxxxxxxxxxxx")
|
||||
stream = session.content_feeder().load(track_id, VorbisOnlyAudioQuality(AudioQuality.AudioQuality.VERY_HIGH), False, None)
|
||||
stream = session.content_feeder().load(track_id, VorbisOnlyAudioQuality(AudioQuality.AudioQuality.VERY_HIGH), False,
|
||||
None)
|
||||
# stream.input_stream.stream().read() to get one byte of the music stream.
|
||||
# ex: 1 (If there is no more voice data, -1 is received as the result.)
|
||||
```
|
||||
|
|
|
@ -69,15 +69,16 @@ aceess_token = session.tokens().get("playlist-read")
|
|||
```python
|
||||
from librespot.core import Session
|
||||
from librespot.metadata import TrackId
|
||||
from librespot.player.codecs import AudioQuality, VorbisOnlyAudioQuality
|
||||
from librespot.player.codecs import VorbisOnlyAudioQuality
|
||||
from librespot.audio.decoders import AudioQuality
|
||||
|
||||
|
||||
session = Session.Builder() \
|
||||
.user_pass("Username", "Password") \
|
||||
session = Session.Builder()
|
||||
.user_pass("Username", "Password")
|
||||
.create()
|
||||
|
||||
track_id = TrackId.from_uri("spotify:track:xxxxxxxxxxxxxxxxxxxxxx")
|
||||
stream = session.content_feeder().load(track_id, VorbisOnlyAudioQuality(AudioQuality.AudioQuality.VERY_HIGH), False, None)
|
||||
stream = session.content_feeder().load(track_id, VorbisOnlyAudioQuality(AudioQuality.AudioQuality.VERY_HIGH), False,
|
||||
None)
|
||||
# stream.input_stream.stream().read() to get one byte of the music stream.
|
||||
# ex: 1 (If there is no more voice data, -1 is received as the result.)
|
||||
```
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
from librespot.audio.decoders.AudioQuality import AudioQuality
|
|
@ -1,5 +1,5 @@
|
|||
from __future__ import annotations
|
||||
from librespot.player.codecs import AudioQuality
|
||||
from librespot.audio.decoders import AudioQuality
|
||||
|
||||
|
||||
class PlayerConfiguration:
|
||||
|
|
|
@ -5,7 +5,7 @@ import typing
|
|||
|
||||
from librespot.audio.format.AudioQualityPicker import AudioQualityPicker
|
||||
from librespot.audio.format.SuperAudioFormat import SuperAudioFormat
|
||||
from librespot.player.codecs.AudioQuality import AudioQuality
|
||||
from librespot.audio.decoders.AudioQuality import AudioQuality
|
||||
from librespot.proto import Metadata
|
||||
|
||||
|
||||
|
|
|
@ -1,2 +1 @@
|
|||
from librespot.player.codecs.AudioQuality import AudioFile
|
||||
from librespot.player.codecs.VorbisOnlyAudioQuality import VorbisOnlyAudioQuality
|
||||
|
|
Loading…
Reference in New Issue