Results 1 to 2 of 2

Thread: Displaying a Wavform with the QGraphics API

  1. #1
    Join Date
    Jul 2011
    Location
    Paris
    Posts
    31
    Thanks
    5
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Displaying a Wavform with the QGraphics API

    Hello,

    I am trying to display the waveform from a wavfile on a widget using the QGraphics architecture. I will use a QGraphicsView as the widget where the waveform will be displayed.

    I would like to know which classes are best and how to get the information from a wavefile to then, paint the corresponding waveform. All the wav data would have to be passed to the paint method in the QGraphicsView?

    Any help with this would be greatly appreciated, thanks!

  2. #2
    Join Date
    Dec 2010
    Location
    Russia
    Posts
    83
    Thanks
    1
    Thanked 12 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Displaying a Wavform with the QGraphics API

    Hey,
    well , grab the wav format specification : it's free .In general Wav file consists of a header and a data itself. containing most of the file-related data. All the "meta" data is stored in the header : file's sampling rate, whether it is mono or stereo , amount of bits per sampling etc. Data contains original signal's amplitude values...that's it. So in case if a sample is coded with a single byte , for a single channel , you can store it's value as unsigned char.Working with 16 bit samples is a little more tricky but since QString offers a great interface to work with the same 16bit unicode characters...not that hard. Once file's data is translated...plot it , there are a lot of examples regarding graphics in Qt.
    P.S: there is great program that performs some great spectrum analysys : FFT Properties (you might want to use it to check if your obtained data is correct or not)

Similar Threads

  1. problem with Qgraphics classes
    By kokeroulis in forum Newbie
    Replies: 2
    Last Post: 18th August 2010, 16:50
  2. Animation and QGraphics
    By PrimeCP in forum Qt Programming
    Replies: 2
    Last Post: 7th May 2009, 00:31
  3. Qgraphics View
    By amagdy.ibrahim in forum Qt Programming
    Replies: 1
    Last Post: 15th June 2008, 10:10
  4. Re: Newbie needs advice - QGraphics
    By Raccoon29 in forum Newbie
    Replies: 1
    Last Post: 24th November 2007, 17:12
  5. QGraphics view problem
    By kiranraj in forum Qt Programming
    Replies: 5
    Last Post: 6th March 2007, 21:28

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.