Add librespot.audio.decoders
This commit is contained in:
12
README.md
12
README.md
@@ -36,18 +36,20 @@ aceess_token = session.tokens().get("playlist-read")
|
|||||||
```
|
```
|
||||||
### Get Music Stream
|
### Get Music Stream
|
||||||
\*Currently, music streaming is supported, but it may cause unintended behavior.
|
\*Currently, music streaming is supported, but it may cause unintended behavior.
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from librespot.core import Session
|
from librespot.core import Session
|
||||||
from librespot.metadata import TrackId
|
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()
|
||||||
session = Session.Builder() \
|
.user_pass("Username", "Password")
|
||||||
.user_pass("Username", "Password") \
|
|
||||||
.create()
|
.create()
|
||||||
|
|
||||||
track_id = TrackId.from_uri("spotify:track:xxxxxxxxxxxxxxxxxxxxxx")
|
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.
|
# 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.)
|
# 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
|
```python
|
||||||
from librespot.core import Session
|
from librespot.core import Session
|
||||||
from librespot.metadata import TrackId
|
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()
|
||||||
session = Session.Builder() \
|
.user_pass("Username", "Password")
|
||||||
.user_pass("Username", "Password") \
|
|
||||||
.create()
|
.create()
|
||||||
|
|
||||||
track_id = TrackId.from_uri("spotify:track:xxxxxxxxxxxxxxxxxxxxxx")
|
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.
|
# 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.)
|
# ex: 1 (If there is no more voice data, -1 is received as the result.)
|
||||||
```
|
```
|
||||||
|
|||||||
1
librespot/audio/decoders/__init__.py
Normal file
1
librespot/audio/decoders/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
from librespot.audio.decoders.AudioQuality import AudioQuality
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
from librespot.player.codecs import AudioQuality
|
from librespot.audio.decoders import AudioQuality
|
||||||
|
|
||||||
|
|
||||||
class PlayerConfiguration:
|
class PlayerConfiguration:
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import typing
|
|||||||
|
|
||||||
from librespot.audio.format.AudioQualityPicker import AudioQualityPicker
|
from librespot.audio.format.AudioQualityPicker import AudioQualityPicker
|
||||||
from librespot.audio.format.SuperAudioFormat import SuperAudioFormat
|
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
|
from librespot.proto import Metadata
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1 @@
|
|||||||
from librespot.player.codecs.AudioQuality import AudioFile
|
|
||||||
from librespot.player.codecs.VorbisOnlyAudioQuality import VorbisOnlyAudioQuality
|
from librespot.player.codecs.VorbisOnlyAudioQuality import VorbisOnlyAudioQuality
|
||||||
|
|||||||
Reference in New Issue
Block a user