As a user of Pianobar, I want to see an option for the User, when they type 'da' command while a song is playing, that the ability to automatically 'download' or 'save' the current playing song is made available.
The way I imagine you could accomplish this is via the 'lame' encoder for converting the audio to MP3.
sudo apt-get install lame (should take care of it)
You could update the code to something like this...
FILE *outfile = NULL;
pthread_mutex_t lock;
int download_audio = 0;
User should be able to set a location of where the Songs can be downloaded. Once there is an option for 'da' songs, it should also be available under the /help or '?' menu.
Actual behavior
The current functionality does NOT appear in the program.
Please let me know if you need additional info. or updated code, since I have NOT yet run this in my environment, but I imagine you used C or C# to build this program out. You could also update the 'Keybindings' for 'act_download' = da or something like it, so becomes available in the config. or the HELP (?) section of the program, as an option.
Hope this can be achieved. If not, at least I tried asking. Thank you for this already awesome program.
Subject of the issue
As a user of Pianobar, I want to see an option for the User, when they type 'da' command while a song is playing, that the ability to automatically 'download' or 'save' the current playing song is made available.
The way I imagine you could accomplish this is via the 'lame' encoder for converting the audio to MP3.
sudo apt-get install lame (should take care of it)
You could update the code to something like this...
FILE *outfile = NULL; pthread_mutex_t lock; int download_audio = 0;
void open_output_file() { outfile = popen("lame -r -s 44.1 - output.mp3", "w"); if (!outfile) { perror("popen"); exit(EXIT_FAILURE); } }
void handle_command(const char *cmd) { if (strcmp(cmd, "da") == 0) { pthread_mutex_lock(&lock); download_audio = 1; open_output_file(); pthread_mutex_unlock(&lock); } else if (strcmp(cmd, "stopda") == 0) { pthread_mutex_lock(&lock); download_audio = 0; close_output_file(); pthread_mutex_unlock(&lock); } }
Your environment
Expected behavior
User should be able to set a location of where the Songs can be downloaded. Once there is an option for 'da' songs, it should also be available under the /help or '?' menu.
Actual behavior
The current functionality does NOT appear in the program.
Please let me know if you need additional info. or updated code, since I have NOT yet run this in my environment, but I imagine you used C or C# to build this program out. You could also update the 'Keybindings' for 'act_download' = da or something like it, so becomes available in the config. or the HELP (?) section of the program, as an option.
Hope this can be achieved. If not, at least I tried asking. Thank you for this already awesome program.
Cheers