Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Problem playing old voc file  (Read 3501 times)

0 Members and 1 Guest are viewing this topic.

bzuidgeest

  • Newbie
  • *
  • Posts: 3
    • View Profile
Problem playing old voc file
« on: December 18, 2018, 12:28:35 pm »
I'm trying to play a voc file from an old dos game I'm trying to convert to c# code (mostly fun programming exercise). I'm using the c# bindings of sfml, but I think the problem is more general to the audio library.

I can play ordinary wav files fine. but when I try to play the voc file I get an error "Failed to load sound buffer from file". Which is a rather generic error. All my other test files are in the same folder.

Both adobe audition and vlc play the voc sound file without problems. its mono and about 6250hz.

I also tried loading the voc data as samples (should no do that it has formatting blocks in there) and created a buffer from those samples as mono and 6250 samplerate. Does not sound pretty, but works. So its not the channel count or samplerate.

I'm guessing whatever is used for loading a voc file has a problem. Or maybe its me :). Anybody here that can help me?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Problem playing old voc file
« Reply #1 on: December 18, 2018, 12:58:42 pm »
What is "voc" format, and what makes you think that it is supported by SFML?

From the documentation:
Quote
The supported audio formats are: WAV (PCM only), OGG/Vorbis, FLAC
Laurent Gomila - SFML developer

bzuidgeest

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Problem playing old voc file
« Reply #2 on: December 18, 2018, 02:11:34 pm »
VOC is an extension for creative voice files. But no matter, It seems I googled an old documentation link. From the version 2.2 documentation:
Quote
bool sf::SoundBuffer::loadFromFile    (    const std::string &     filename   )    

Load the sound buffer from a file.

Here is a complete list of all the supported audio formats: ogg, wav, flac, aiff, au, raw, paf, svx, nist, voc, ircam, w64, mat4, mat5 pvf, htk, sds, avr, sd2, caf, wve, mpc2k, rf64.

Apparently file format support has been more limited in recent versions. I will write the code to convert to wav myself. Should not be to difficult. Thanks for waking me up :)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Problem playing old voc file
« Reply #3 on: December 18, 2018, 02:47:47 pm »
Indeed, we've got rid of the libsndfile library and reimplemented support for the most common audio formats ourselves.
Laurent Gomila - SFML developer

 

anything