five_dollar_shake
five_dollar_shake

Reputation: 378

Play file audio

I have a raw data file of a sound recording, with each sample stored as a 16 bit short. I want to play this file through Redhawk.

I have a file_source_s connected to AudioSink like so: file_source_s_1 component connected to AudioSink

I was expecting to hear sound from my speakers when starting these components. But when I start both components, I cannot hear any sound.

Here are the file_source_s properties values:

I know:

Upvotes: 1

Views: 241

Answers (1)

Youssef Bagoulla
Youssef Bagoulla

Reputation: 1247

The AudioSink component uses the information from the received SRI (Signal Related Information) in order to determine the audio's sample rate. This is seen here from line 156 of the AudioSink component:

int sample_rate = static_cast<int>(rint(1.0/current_sri.xdelta));

It receives the SRI from downstream components, in this case, file_source_s.

The component file_source_s is part of the gnuhawk component package. The GNUHAWK library provides software that enables a GNU Radio block to be integrated into the REDHAWK software framework. Since SRI is a REDHAWK construct and not present in GNURADIO, it does not appear as though the file_source_s block gathers enough information via properties to represent the correct xdelta / sample rate for the audio file.

I'd recommend using a pure REDHAWK component like DataReader which takes in as a property the sample rate.

Upvotes: 3

Related Questions