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

Author Topic: Abusing SoundBuffer for file conversion  (Read 2476 times)

0 Members and 1 Guest are viewing this topic.

wintertime

  • Sr. Member
  • ****
  • Posts: 255
    • View Profile
Abusing SoundBuffer for file conversion
« on: October 19, 2013, 01:30:32 am »
I just want to make sure that using a quick Ruby script like this is a sensible thing to do and I'm not doing something very wrong.
require 'sfml/audio'
include SFML

fn_in=ARGV[0]+'.flac'
fn_out=ARGV[0]+'.ogg'

sb=SoundBuffer.new
sb.loadFromFile fn_in
sb.saveToFile fn_out
 
What got me a little nervous was that converting some 5MB .wav files with some other program produced nearly 1MB .ogg files and a script like above produced files at about half the size.
Now I know there is most likely just a different encoding quality, though I could not hear a difference and I'm happy about the reduced size from that little experiment with the script. Just to be sure, there are no obvious shortcuts taken like reducing stereo to mono, right?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Abusing SoundBuffer for file conversion
« Reply #1 on: October 19, 2013, 08:03:31 am »
No, there's no such thing ;)
Laurent Gomila - SFML developer

wintertime

  • Sr. Member
  • ****
  • Posts: 255
    • View Profile
Re: Abusing SoundBuffer for file conversion
« Reply #2 on: October 19, 2013, 12:29:11 pm »
Thank you, that spares me of having to look for some new utility that understands .flac, after I spend too much time already searching for suitable asset files like fonts and music. :)