2

I am trying to download an mp3 stream via curl. Everything works well if it's a casual file, but with mp3 stream some strange things start to happen. The downloaded audio sounds really bad, music is inaudible, harsh, like it was cut into many little pieces. Do I have to set up some additional options for downloading such stream?

Here's my code:

#include <stdlib.h>
#include <stdio.h>
#include <curl/curl.h>

CURL *curl;
FILE *file;

int main(void)
{
    file = fopen("download.mp3", "w");

    curl = curl_easy_init();
    curl_easy_setopt(curl, CURLOPT_URL, "http://beck.wnpid.amu.edu.pl:8000/meteor-mp3");
    curl_easy_setopt(curl, CURLOPT_WRITEDATA, file);
    curl_easy_perform(curl);
    curl_easy_cleanup(curl);
    fclose(file);

    exit(EXIT_SUCCESS);
}
kwybryk
  • 21
  • 2

0 Answers0