Link to home
Start Free TrialLog in
Avatar of hacqua
hacqua

asked on

Store/play sounds using Paradox table

I'm trying to write an application that will record voice messages and store them in a Paradox table for later playing. I think I could use TMediaPlayer to record and play the messages, but I don't know how to store and play them using a table. Can someone help me? (please suply code samples).
Avatar of rwilson032697
rwilson032697

Set up a blob field in your database (lets call it 'message'). In you code do this:

// After recording the sound you have a file like sound.wav To save it do this:

  (AQuery.FieldsByName['Message'] as TBlobField).LoadFromFile('sound.wav');

// To play the sound, do this:

  (AQuery.FieldsByName['Message'] as TBlobField).SaveToFile('sound.wav');

// Then play it with media player, like this:

  TheMediaPlayer.FileName := 'sound.wav';
  TheMediaPlayer.Open;
  TheMediaPlayer.Play;

How does this sound? <g>

Cheers,

Raymond.

ASKER CERTIFIED SOLUTION
Avatar of simonet
simonet
Flag of Brazil image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hey Alex, stop hunting with a .50 calibre will ya?!?

Cheers,

Raymond.

Avatar of hacqua

ASKER

Thank you very much for your answer, rwilson, but I think Simonet solution is closer to my needs, because he also shows how to create a wave file manually in different frequencies. If I could, I would give you both the points, really.

Simonet, muito obrigado pela resposta. É muito bom ver um brasileiro no "topo". Um abraço!
Obrigado, hacqua!

É bom saber que eu não sou o único brasileiro por aqui, e venho constantando que estamos marcando uma presença significante por aqui.

Abraços,

Alex