MP3 Player without external hardware MP3 Player without external hardware. A software based MP3 player based on a modified version of libmad. Mono output (at the moment) via AnalogOut. Files are read from an USB drive. This is a demo program, it plays only one file at the moment. Documentation is in "main.cpp" and "config.h"

Dependencies:   mbed

Committer:
Gruenfrosch
Date:
Sat Nov 27 17:27:33 2010 +0000
Revision:
2:f28cf0afd021
Parent:
0:7627c79db971
Version 3:
* moved another memory block into AHB RAM, giving more room for
* stereo buffer.
* moved content of decode() to main()
* decoding is now safe to be called multiple times (bug in older versions)
* Output routine now fills stereo buffer, DAC output sums channels,
* just for demonstration that stereo output could go here

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Gruenfrosch 0:7627c79db971 1 /* USB Mass Storage device file system
Gruenfrosch 0:7627c79db971 2 * Copyrigh (c) 2010, Igor Skochinsky
Gruenfrosch 0:7627c79db971 3 * based on SDFileStorage
Gruenfrosch 0:7627c79db971 4 * Copyright (c) 2008-2009, sford
Gruenfrosch 0:7627c79db971 5 */
Gruenfrosch 0:7627c79db971 6
Gruenfrosch 0:7627c79db971 7 #ifndef MSCFILESYSTEM_H
Gruenfrosch 0:7627c79db971 8 #define MSCFILESYSTEM_H
Gruenfrosch 0:7627c79db971 9
Gruenfrosch 0:7627c79db971 10 #include "mbed.h"
Gruenfrosch 0:7627c79db971 11 #include "FATFileSystem.h"
Gruenfrosch 0:7627c79db971 12
Gruenfrosch 0:7627c79db971 13 /* Class: MSCFileSystem
Gruenfrosch 0:7627c79db971 14 * Access the filesystem on an attached USB mass storage device (e.g. a memory stick)
Gruenfrosch 0:7627c79db971 15 *
Gruenfrosch 0:7627c79db971 16 * Example:
Gruenfrosch 0:7627c79db971 17 * > MSCFileSystem msc("msc");
Gruenfrosch 0:7627c79db971 18 * >
Gruenfrosch 0:7627c79db971 19 * > int main() {
Gruenfrosch 0:7627c79db971 20 * > FILE *fp = fopen("/msc/myfile.txt", "w");
Gruenfrosch 0:7627c79db971 21 * > fprintf(fp, "Hello World!\n");
Gruenfrosch 0:7627c79db971 22 * > fclose(fp);
Gruenfrosch 0:7627c79db971 23 * > }
Gruenfrosch 0:7627c79db971 24 */
Gruenfrosch 0:7627c79db971 25 class MSCFileSystem : public FATFileSystem {
Gruenfrosch 0:7627c79db971 26 public:
Gruenfrosch 0:7627c79db971 27
Gruenfrosch 0:7627c79db971 28 /* Constructor: MSCFileSystem
Gruenfrosch 0:7627c79db971 29 * Create the File System for accessing a USB mass storage device
Gruenfrosch 0:7627c79db971 30 *
Gruenfrosch 0:7627c79db971 31 * Parameters:
Gruenfrosch 0:7627c79db971 32 * name - The name used to access the filesystem
Gruenfrosch 0:7627c79db971 33 */
Gruenfrosch 0:7627c79db971 34 MSCFileSystem(const char* name);
Gruenfrosch 0:7627c79db971 35 virtual int disk_initialize();
Gruenfrosch 0:7627c79db971 36 virtual int disk_write(const char *buffer, int block_number);
Gruenfrosch 0:7627c79db971 37 virtual int disk_read(char *buffer, int block_number);
Gruenfrosch 0:7627c79db971 38 virtual int disk_status();
Gruenfrosch 0:7627c79db971 39 virtual int disk_sync();
Gruenfrosch 0:7627c79db971 40 virtual int disk_sectors();
Gruenfrosch 0:7627c79db971 41
Gruenfrosch 0:7627c79db971 42 protected:
Gruenfrosch 0:7627c79db971 43
Gruenfrosch 0:7627c79db971 44 int initialise_msc();
Gruenfrosch 0:7627c79db971 45 uint32_t _numBlks;
Gruenfrosch 0:7627c79db971 46 uint32_t _blkSize;
Gruenfrosch 0:7627c79db971 47 };
Gruenfrosch 0:7627c79db971 48
Gruenfrosch 0:7627c79db971 49 #endif