Skip to content

Support saving audio files #152

@paulo-raca

Description

@paulo-raca

On my spotify-based application, I don't want to just playback the live audio stream, but also to fetch it for offline playback later.

So... Question 1, how do you fell about adding a fetch_audio_file method to the library, and what would be the best way to implement it?

I have hacked a simple patch to do so: paulo-raca/librespot@a83f355

It basically splits the flow of load_track in half:

  • The part responsible for fetching and decrypting the audio file is now on get_track_file, and is shared with the implementation of fetch_audio_file
  • The part that skips the first few bytes of the file (Ogg headers?) and creates a decoder continues implemented within load_track.

This works perfectly for Ogg Vorbis files, but not at all for other formats:

  • Using OTHER2 fetches a file successfully, but appears to be garbage (Maybe it has a different decryption scheme? Maybe I just have no idea what is the file format?)
  • Every other format panics with AudioKeyError.

Question 2, Has there been any investigation on the decryption of those files? (I'm mainly interested in AAC or FLAC

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions