Go Down

Topic: Foobar2000 (Read 240 times) previous topic - next topic

danieledom

Hi all. Very new to Arduino and Forums. Excuse me if I break some rules! What I would like to make is  a file analyzer that can show in a lcd display what file and @ what sampling frq I am playing through Foobar2000 (Windows). Name of song, Author, kind of file and sampling freq (Eg. Badge - Cream - PCM 192khz - 48 bits/s. Thank you for letting me know if that would be possible, and how. Cheers. Danny

Robin2

I think what you want to do is be able to play a song on your PC using the program Foobar2000 and at the same time use an Arduino with an LCD display to show some details about the file being played?

If so that would be possible IF ... you have a PC program that can collect the details and send them to your Arduino over a serial connection.

An Arduino has no access to what goes on inside a PC - it must rely entirely on a PC program sending it information.



For receiving the data on the Arduino have a look at the examples in Serial Input Basics - simple reliable ways to receive data. There is also a parse example to illustrate how to extract numbers from the received text.

The technique in the 3rd example will be the most reliable. It is what I use for Arduino to Arduino and Arduino to PC communication.

You can send data in a compatible format with code like this (or the equivalent in any other programming language)
Code: [Select]
Serial.print('<'); // start marker
Serial.print(value1);
Serial.print(','); // comma separator
Serial.print(value2);
Serial.println('>'); // end marker


...R
Two or three hours spent thinking and reading documentation solves most programming problems.

pert

Foobar2000 is pretty good for this sort of thing. I don't know of a Foobar2000 component that would allow it to directly communicate with the Arduino. So you need to have another program that can get the information from Foobar200 and then pass it to the Arduino. For that purpose, I'm using a program called EventGhost:
http://www.eventghost.net/
but you could use any number of existing programs, or just make your own.



One technique is to use the "Now Playing Simple" Foobar2000 component. You can use this to write the track data to a text file on your hard drive. It will automatically update the file each time a new track plays. You can then read the data from that file from the program that communicates with the Arduino.



Another technique would be to use the "Run services" (foo_run) component, which can pass the information back to the other program when the service is triggered. For example, I have a service named "Track ID" defined:
Code: [Select]
"C:\Program Files '('x86')'\EventGhost\EventGhost.exe" -e foobar2000osd "$meta(title) - $meta(artist) - %codec% %samplerate% - %bitrate% kbits/s"
That triggers the foobar2000osd event in EventGhost with the payload that contains Title - Artist - Codec Sample Rate - Bit rate kbits/s as the payload.

So how do you trigger the service? One option is to use the "Run command" (foo_runcmd) component. With this component installed, you can control all the functions of Foobar2000 from the command line. So I can trigger the "Track ID" service on the currently playing track like this:
Code: [Select]
"C:\Program Files (x86)\foobar2000\foobar2000" /runcmd-playing="Run service/Track ID"

Another method for triggering the service is to assign a keyboard shortcut to the service, then emulate that keyboard shortcut from the program that communicates with the Arduino.



Any of the above, as well as communicating with your Arduino over serial or the network is fairly easy with EventGhost

danieledom

Great! Thanks a lot to both. I think I have enough infos to try experimenting together with a arduino learned  friend of mine. Cheers

Go Up