static void
audio (std::shared_ptr<AudioBuffers> audio, int channels)
{
/* Check that we have a big enough buffer */
static void
audio (std::shared_ptr<AudioBuffers> audio, int channels)
{
/* Check that we have a big enough buffer */
ref = sf_open (file.string().c_str(), SFM_READ, &info);
/* We don't want to test anything that requires resampling */
BOOST_REQUIRE_EQUAL (info.samplerate, 48000);
ref = sf_open (file.string().c_str(), SFM_READ, &info);
/* We don't want to test anything that requires resampling */
BOOST_REQUIRE_EQUAL (info.samplerate, 48000);
/* We don't want to test anything that requires resampling */
BOOST_REQUIRE_EQUAL (info.samplerate, 48000);
/* We don't want to test anything that requires resampling */
BOOST_REQUIRE_EQUAL (info.samplerate, 48000);
dcp::SoundAsset asset (dcp_file(film, "pcm"));
auto reader = asset.start_read ();
for (int i = 0; i < asset.intrinsic_duration(); ++i) {
auto frame = reader->get_frame(i);
sf_count_t this_time = min (info.frames, sf_count_t(2000));
dcp::SoundAsset asset (dcp_file(film, "pcm"));
auto reader = asset.start_read ();
for (int i = 0; i < asset.intrinsic_duration(); ++i) {
auto frame = reader->get_frame(i);
sf_count_t this_time = min (info.frames, sf_count_t(2000));
for (int j = 0; j < this_time; ++j) {
BOOST_REQUIRE_EQUAL (frame->get(2, j) >> 8, buffer[j]);
}
info.frames -= this_time;
}
for (int j = 0; j < this_time; ++j) {
BOOST_REQUIRE_EQUAL (frame->get(2, j) >> 8, buffer[j]);
}
info.frames -= this_time;
}
/* We don't want to test anything that requires resampling */
BOOST_REQUIRE_EQUAL (info.samplerate, 48000);
/* We don't want to test anything that requires resampling */
BOOST_REQUIRE_EQUAL (info.samplerate, 48000);
dcp::SoundAsset asset (dcp_file(film, "pcm"));
auto reader = asset.start_read ();
for (int i = 0; i < asset.intrinsic_duration(); ++i) {
auto frame = reader->get_frame(i);
sf_count_t this_time = min (info.frames, sf_count_t(2000));
dcp::SoundAsset asset (dcp_file(film, "pcm"));
auto reader = asset.start_read ();
for (int i = 0; i < asset.intrinsic_duration(); ++i) {
auto frame = reader->get_frame(i);
sf_count_t this_time = min (info.frames, sf_count_t(2000));
for (int j = 0; j < this_time; ++j) {
int32_t s = frame->get(2, j);
if (s > (1 << 23)) {
for (int j = 0; j < this_time; ++j) {
int32_t s = frame->get(2, j);
if (s > (1 << 23)) {
/* We don't want to test anything that requires resampling */
BOOST_REQUIRE_EQUAL (info.samplerate, 48000);
/* We don't want to test anything that requires resampling */
BOOST_REQUIRE_EQUAL (info.samplerate, 48000);
dcp::SoundAsset asset (dcp_file(film, "pcm"));
auto reader = asset.start_read ();
for (int i = 0; i < asset.intrinsic_duration(); ++i) {
auto frame = reader->get_frame(i);
sf_count_t this_time = min (info.frames, sf_count_t(2000));
dcp::SoundAsset asset (dcp_file(film, "pcm"));
auto reader = asset.start_read ();
for (int i = 0; i < asset.intrinsic_duration(); ++i) {
auto frame = reader->get_frame(i);
sf_count_t this_time = min (info.frames, sf_count_t(2000));
for (int j = 0; j < this_time; ++j) {
int32_t s = frame->get(2, j);
if (s > (1 << 23)) {
for (int j = 0; j < this_time; ++j) {
int32_t s = frame->get(2, j);
if (s > (1 << 23)) {