Welcome to the MP3Car.com forums.
You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. Registering will also remove advertisements. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!
If you have any problems with the registration process or your account login, please contact contact us.
|
03-09-2006, 09:20 PM
|
#16
|
|
FLAC
Join Date: Jul 2004
Location: All over the world
Vehicle: 2001 Paper Airplane Standard Edition
Posts: 984
|
Yeah, I'm grabbing 512 values in the analyser array. If you look at analyserScale, that is what I use for sampling the 512 values into 40 values. Hehe, yeah FMOD really is great. I want to try using FMOD Ex in the next day or two.
|
|
|
03-10-2006, 10:57 AM
|
#17
|
|
Variable Bitrate
Join Date: Jul 2005
Location: Ottawa, ON, Canada
Vehicle: 2005 Ford Freestar Limited
Posts: 288
|
I'll post the code on silverwolf.intuitionsys.com when 1.3 reaches fruition if you're curious. The major changes will be in audio.cpp/h (new wrapper class for fmod) and fft.cpp/h.
__________________
Silverwolf 2.0 Progress: 100% (alpha)
Alpha Release Date: June 28, 2007
|
|
|
03-13-2006, 05:19 PM
|
#18
|
|
Variable Bitrate
Join Date: Jul 2005
Location: Ottawa, ON, Canada
Vehicle: 2005 Ford Freestar Limited
Posts: 288
|
I'm finding I'm getting MUCH better results using linear scaling as opposed to logarithmic scaling. I'm just wondering if there isn't a mistake in the docs for FMOD Ex...
Basically fSpec[i] = -120.0 * fSpec[i] / fMax for each channel yields what you would expect to get from the logarithmic conversion. All the math in the display is linear so I'm kinda thinking maybe the data is already scaled (in Ex anyway).
__________________
Silverwolf 2.0 Progress: 100% (alpha)
Alpha Release Date: June 28, 2007
|
|
|
03-13-2006, 06:00 PM
|
#19
|
|
Low Bitrate
Join Date: Mar 2000
Location: Northville, MI, USA
Posts: 63
|
Okay.. Stupid Question
Okay.. Stupid Question
I realize FMOD is an audio library.. and that you're writing front ends. I too am writing a front end, but have not gotten to the audio part of it yet.
Does FMOD do everything from loading the file, give you spectrum data, do your mixer settings, and send it to your audio device.... or does it do some subset of this?
I'm writing my code in QT4.1 / C++. Would what you're working on apply to what I hope to soon be doing?
-Chris
|
|
|
03-13-2006, 06:11 PM
|
#20
|
|
Variable Bitrate
Join Date: Jul 2005
Location: Ottawa, ON, Canada
Vehicle: 2005 Ford Freestar Limited
Posts: 288
|
Quote: Originally Posted by strandtc
Okay.. Stupid Question
As Dr. Craig Hawkins would say, "the only stupid question is the one not asked"
Quote: Originally Posted by strandtc
Does FMOD do everything from loading the file, give you spectrum data, do your mixer settings, and send it to your audio device.... or does it do some subset of this?
Yes on all three. It won't act as a master daemon like esd or artsd but if all the audio originates within your app you're okay.
Quote: Originally Posted by strandtc
I'm writing my code in QT4.1 / C++. Would what you're working on apply to what I hope to soon be doing?
I would think so. Silverwolf (my app) has actually been complete (and available for download) for some time now but I'm in the process of gutting the audio subsections to use FMOD, mainly so I no longer need to rely on aRts, KDE or MPG123. The biggest challenge will be piping Xine audio (what I use for the video subsections - DVD ISOs, TV, etc.) to my app since it runs as a seperate process.
btw alot of mine uses Qt 3.3.5 (3.3.6 as of yesterday). I may jump on the 4.1 bandwagon eventually...
__________________
Silverwolf 2.0 Progress: 100% (alpha)
Alpha Release Date: June 28, 2007
|
|
|
03-13-2006, 06:42 PM
|
#21
|
|
Low Bitrate
Join Date: Mar 2000
Location: Northville, MI, USA
Posts: 63
|
Qt 4.1
QT4.1 (4.01 had some paint engine bugs) was a nice upgrade for me.
I'm skinning my app, and 4.1 includes Alpha Blending (I'm using PNG images).. and anti aliasing. So far I'm impressed with the results. Fixed the problems I had with 3.3 and widget background origins.
How much audio does your app do? Mostly playback? Or do you use sound effects for events (button clicks, screen changes, etc)?
In relation to Xine... is it possible for Xine and your app to both send audio out, or can only 1 app send audio to oss/alsa/etc?
Thanks,
-Chris
|
|
|
03-14-2006, 01:12 AM
|
#22
|
|
Low Bitrate
Join Date: Mar 2000
Location: Northville, MI, USA
Posts: 63
|
I know this isn't my thread.. but looking at your Silverwold code, I'm very impressed so far. Its actually readable!
I would be very interested in looking at your fmod code, specially if you write a QObject wrapper with signals and slots around it.
I also have some questions about your Xine controls... but do you guys want me to start another thread?
-Chris
Quote: Originally Posted by intuitionsys
I'll post the code on silverwolf.intuitionsys.com when 1.3 reaches fruition if you're curious. The major changes will be in audio.cpp/h (new wrapper class for fmod) and fft.cpp/h.
|
|
|
03-14-2006, 10:49 AM
|
#23
|
|
Variable Bitrate
Join Date: Jul 2005
Location: Ottawa, ON, Canada
Vehicle: 2005 Ford Freestar Limited
Posts: 288
|
Quote: Originally Posted by strandtc
I know this isn't my thread.. but looking at your Silverwold code, I'm very impressed so far. Its actually readable!
Yeah I'm not a big fan of unintended obfuscated C
Quote: Originally Posted by strandtc
I would be very interested in looking at your fmod code, specially if you write a QObject wrapper with signals and slots around it.
Once I've completed the move I'll be posting the code as version 1.3 on my site.
Quote: Originally Posted by strandtc
I also have some questions about your Xine controls... but do you guys want me to start another thread?
This thread isn't exclusive to Llama and myself. Llama just wanted to keep this thread technically oriented to real programming and integration issues, so if that's the vein of your query, post on dude...
As for Xine control, what I'm doing if you haven't gathered from the code already, is simply embedding (or rather "psuedo-embedding" to be accurate) the xine-ui process to draw a borderless window with exact geometry over an existing QDialog (unless you're in full-screen mode). It is controlled via a socket connection to the process, except where there is no remote command and then it just sends an X Event to the Xine window emulating a keypress, e.g. to change the audio latency.
Now that I've moved to FMOD and ditched aRts, I've got four options; 1) Use something besides Xine that has the same controllability but is either easily truliy embeddable or at least easier to pipe audio to another app, 2) Close the FMOD system library to release the audio device when Xine is playing, 3) Keep using Xine and write a plugin that Xine can use to pipe its audio to Silverwolf so it can be processed by FMOD, or 4) Completely embed Xine into Silverwolf.
Option 2 is obviously the easiest and that's probably what I'll do for the short term, and it's not that big a sacrifice. Option 4 is obviously the holy grail unless I find something that works better of course.
Quote: Originally Posted by strandtc
How much audio does your app do? Mostly playback? Or do you use sound effects for events (button clicks, screen changes, etc)?
It does everything except recording. There are sounds for every button click, every module openning, startup, as well as voice synthesis. The voice synthesis could actually be replaced with static sounds pieced together. Things like "Navigation safety disabled" could simply be a static wav file, and things like "Playlist 46" could be pieced together from "Playlist", "forty" and "six" which would probably sound better anyway with a sexy female voice - although I doubt I'll talk my wife into doing that 
__________________
Silverwolf 2.0 Progress: 100% (alpha)
Alpha Release Date: June 28, 2007
|
|
|
03-14-2006, 11:36 AM
|
#24
|
|
FLAC
Join Date: Jul 2004
Location: All over the world
Vehicle: 2001 Paper Airplane Standard Edition
Posts: 984
|
Cool, people are starting to get interested in Linux players. It sounds like we are all sort of doing the same thing with FMOD. You guys are wrapping it a class derived from QObject while I'm encapsulating mine in a class derived from sigc::trackable to provide signals/slots. BTW, I'm using sigc::trackable because I'm not using full-blown GTK or QT and libsigc++ is a separate package.
On another note, I haven't completed much with my player except CAD'ing a new enclosure. I'm going to have VeritasForge pound one out of stainless steel.
Also, has anyone tried using SQLite with Apache/PHP5?
|
|
|
03-14-2006, 12:11 PM
|
#25
|
|
Low Bitrate
Join Date: Mar 2000
Location: Northville, MI, USA
Posts: 63
|
Another question. I have been messing around with FMOD, just doing some initial testing. I downloaded the library (fmod ex) and compiled the examples.
playstream plays back an mp3 that comes with the library. It sounds "fast" and has some sort of artifact in it. I wrote my own simple C++ app with the start of a QObject wrapper, and it does the same thing.. on a few different test mp3's I have.
I'm compairing the playback to xmms, and mplayer.. and there is a HUGE difference in audio quality.
Did you guys run into this?
-Chris
|
|
|
03-14-2006, 01:10 PM
|
#26
|
|
FLAC
Join Date: Jul 2004
Location: All over the world
Vehicle: 2001 Paper Airplane Standard Edition
Posts: 984
|
Quote: Originally Posted by strandtc
Did you guys run into this?
-Chris
Nope. Have you tried other MP3s?
Edit: Doh, just re-read the post. I'm not sure what is wrong then. FMOD has excellent sound quality for me.
|
|
|
03-14-2006, 01:57 PM
|
#27
|
|
Variable Bitrate
Join Date: Jul 2005
Location: Ottawa, ON, Canada
Vehicle: 2005 Ford Freestar Limited
Posts: 288
|
Me either. FMOD has been a godsend for the most part (except the licensing  )
Are you doing anything funky beyond createStream() or createSound(), i.e. DSP effects, 3D, etc.?
I'm using FMOD_SOFTWARE in the createStream() call since spectrum data isn't available when using FMOD_HARDWARE. Are you doing the same?
__________________
Silverwolf 2.0 Progress: 100% (alpha)
Alpha Release Date: June 28, 2007
|
|
|
03-14-2006, 03:10 PM
|
#28
|
|
Low Bitrate
Join Date: Mar 2000
Location: Northville, MI, USA
Posts: 63
|
I don't think I'm doing anything different. I basically copied the playstream code segments into a QObject structure.
Thinning down my code for space (removing comments and err checking)
The Object has a couple variables as members....
FMOD::System *system;
FMOD::Sound *sound;
FMOD::Channel *channel;
So my constructor has:
{
FMOD_RESULT result;
result = FMOD::System_Create(&system);
result = system->init(1, FMOD_INIT_NORMAL, 0);
}
Play Member Function:
{
result = system->createSound("../media/wave.mp3", FMOD_SOFTWARE | FMOD_2D | FMOD_CREATESTREAM, 0, &sound);
result = system->playSound(FMOD_CHANNEL_FREE, sound, false, &channel);
}
Destructor:
{
result = sound->release();
result = system->close();
result = system->release();
}
I also tried "createStream" insted of "createSound" using the default arguments listed in the documentation (FMOD_DEFAULT), with the same results.
I havn't tried a wav file yet.. thats my next try.
-Chris
|
|
|
03-15-2006, 12:01 PM
|
#29
|
|
Variable Bitrate
Join Date: Jul 2005
Location: Ottawa, ON, Canada
Vehicle: 2005 Ford Freestar Limited
Posts: 288
|
re the spectrum, last night I again tried numerous logarithmic and linear equations to adjust the spectrum to more closely indicate reality and found that something slightly similar to Llama's original method worked best, at least as far as the coordination between my eyes and ears is concerned:
Logarithmic scaling such as 10 * log10( f ) * 2 result in far too much "averaging" (actually not averaging but it appears as such when the curve is plotted verbatim) where things like drum beats in relative silence are not nearly as pronounced as they should be.
Pure linear scaling without scaling for max across the spectrum results in inordinately low values across the spectrum. This lines up with what's in the API docs.
Linear scaling adjusting for max across the spectrum yields a much more visually indicative spectrum but the gain drops sharply from 1/2 nyquist to nyquist, showing a lopsided spectrum favoring the bass frequencies with very little response to obvious high frequency spikes, such as a cymbal crash.
So what I ended up with was this:
Sample the spectrum
Find the L and R max points
Scale the spectrum according to the max points
Apply a linear gain, increasing from no gain to max gain across 1/2 nyquist to nyquist
This yielded (at least for me) a very realistic and responsive spectrum. If anyone is curious I can post the code which lies entirely inside an overridden QObject::timerEvent().
__________________
Silverwolf 2.0 Progress: 100% (alpha)
Alpha Release Date: June 28, 2007
|
|
|
03-15-2006, 12:20 PM
|
#30
|
|
FLAC
Join Date: Jul 2004
Location: All over the world
Vehicle: 2001 Paper Airplane Standard Edition
Posts: 984
|
Quote: Originally Posted by intuitionsys
This yielded (at least for me) a very realistic and responsive spectrum. If anyone is curious I can post the code which lies entirely inside an overridden QObject::timerEvent().
Cool, I'm glad I could point you in the right direction. Now would be a good time to get that pub-ftp or BB up and post the spectrum and fmod classes. I just regressed my original values to find the equations that I like. To make it so the user can adjust the spectrum settings to their own taste - I think that the best idea is to calculate the look-up arrays at startup. I'm thinking of either having it so the user plugs the values into A * log( f * D ) * B / log(C). That, or have a simple parser that can read in an equation symbolicly.
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 02:16 AM.
|
|