| 615 | |
| 616 | |
| 617 | result WavStream::parse(File *aFile) |
| 618 | { |
| 619 | int tag = aFile->read32(); |
| 620 | int res = SO_NO_ERROR; |
| 621 | if (tag == MAKEDWORD('O', 'g', 'g', 'S')) |
| 622 | { |
| 623 | res = loadogg(aFile); |
| 624 | } |
| 625 | else |
| 626 | if (tag == MAKEDWORD('R', 'I', 'F', 'F')) |
| 627 | { |
| 628 | res = loadwav(aFile); |
| 629 | } |
| 630 | else |
| 631 | if (tag == MAKEDWORD('f', 'L', 'a', 'C')) |
| 632 | { |
| 633 | res = loadflac(aFile); |
| 634 | } |
| 635 | else |
| 636 | if (loadmp3(aFile) == SO_NO_ERROR) |
| 637 | { |
| 638 | res = SO_NO_ERROR; |
| 639 | } |
| 640 | else |
| 641 | { |
| 642 | res = FILE_LOAD_FAILED; |
| 643 | } |
| 644 | return res; |
| 645 | } |
| 646 | |
| 647 | AudioSourceInstance *WavStream::createInstance() |
| 648 | { |