step = 1000;
}
if (step > 0) {
- samps = step * (fh->samplerate / 1000);
+ samps = step * (fh->native_rate / 1000);
switch_core_file_seek(fh, &pos, samps, SEEK_CUR);
} else {
- samps = abs(step) * (fh->samplerate / 1000);
+ samps = abs(step) * (fh->native_rate / 1000);
switch_core_file_seek(fh, &pos, fh->pos - samps, SEEK_SET);
}
} else {
- samps = atoi(p) * (fh->samplerate / 1000);
+ samps = atoi(p) * (fh->native_rate / 1000);
switch_core_file_seek(fh, &pos, samps, SEEK_SET);
}
}
step = 1000;
}
- samps = step * (fhp->samplerate / 1000);
+ samps = step * (fhp->native_rate / 1000);
target = (int32_t)fhp->pos + samps;
if (target < 0) {
switch_core_file_seek(fhp, &pos, target, SEEK_SET);
} else {
- samps = switch_atoui(p) * (fhp->samplerate / 1000);
+ samps = switch_atoui(p) * (fhp->native_rate / 1000);
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "seek to position %d\n", samps);
switch_core_file_seek(fhp, &pos, samps, SEEK_SET);
}
}
if (read_impl.actual_samples_per_second) {
- switch_channel_set_variable_printf(channel, "record_seconds", "%d", fh->samples_out / fh->samplerate);
- switch_channel_set_variable_printf(channel, "record_ms", "%d", fh->samples_out / (fh->samplerate/ 1000));
+ switch_channel_set_variable_printf(channel, "record_seconds", "%d", fh->samples_out / fh->native_rate);
+ switch_channel_set_variable_printf(channel, "record_ms", "%d", fh->samples_out / (fh->native_rate/ 1000));
}
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "done playing file %s\n", file);
if (read_impl.samples_per_second) {
- switch_channel_set_variable_printf(channel, "playback_seconds", "%d", fh->samples_in / fh->samplerate);
- switch_channel_set_variable_printf(channel, "playback_ms", "%d", fh->samples_in / fh->samplerate);
+ switch_channel_set_variable_printf(channel, "playback_seconds", "%d", fh->samples_in / fh->native_rate);
+ switch_channel_set_variable_printf(channel, "playback_ms", "%d", fh->samples_in / fh->native_rate);
}
switch_channel_set_variable_printf(channel, "playback_samples", "%d", fh->samples_in);