Cd -> ogg



  • Hallo ich will mal versuchen in C++ eine CD zu rippen und als .ogg abzuspeichern. Leider kapiere ich die Anleitung nicht so ganz:

    Encoding workflow

    Initialize a vorbis_info structure by calling vorbis_info_init and then functions from libvorbisenc on it.
    Initialize a vorbis_dsp_state for encoding based on the parameters in the vorbis_info by using vorbis_analysis_init.
    Initialize a vorbis_comment structure using vorbis_comment_init, populate it with any comments you wish to store in the stream, and call vorbis_analysis_headerout to get the three Vorbis stream header packets. Output the packets.
    Initialize a vorbis_block structure using vorbis_block_init.
    While there is more audio to encode:
    Submit a chunk of audio data using vorbis_analysis_buffer and vorbis_analysis_wrote.
    Obtain all available blocks using vorbis_analysis_blockout in a loop. For each block obtained:
    Encode the block into a packet (or prepare it for bitrate management) using vorbis_analysis. (It's a good idea to always pass the blocks through the bitrate management mechanism; more information is on the vorbis_analysis page. It does not affect the resulting packets unless you are actually using a bitrate-managed mode.)
    If you are using bitrate management, submit the block using vorbis_bitrate_addblock and obtain packets using vorbis_bitrate_flushpacket.
    Output any obtained packets.
    Submit an empty buffer to indicate the end of input; this will result in an end-of-stream packet after all encoding steps are done to it.
    Destroy the structures using the appropriate vorbis_*_clear routines.

    Es sthet immr dabei dass iche irgendeine Struktur zB vorbis_info anlegen soll.
    Aber an welcher Stelle erhält dieser Workflow seine Daten? Also wo muss ich tatsächlich die Daten der CD und in welchem Format hinschicken?



  • Aber an welcher Stelle erhält dieser Workflow seine Daten? Also wo muss ich tatsächlich die Daten der CD und in welchem Format hinschicken?

    an der Stelle

    While there is more audio to encode:
    Submit a chunk of audio data using vorbis_analysis_buffer and vorbis_analysis_wrote.



  • Xiph bietet verschiedene Abstraktionsstufen an. libogg und libvorbis bieten low-level APIs an. Wenn Du nur reine Vorbis-Dateien kodieren und dekodieren willst, reicht Dir wahrscheinlich auch schon libvorbisenc und libvorbisfile. Diese Bibliotheken setzen auf libogg und libvorbis auf und bieten Dir eine einfacher zu benutzende Schnittstelle (soweit ich weiß). Ich habe mich da aber auch nicht intensiv mit auseinander gesetzt.

    Diese Bibliotheken werden die Audiodaten mindestens in einem Format annehmen: 16-Bit PCM.


Anmelden zum Antworten