Changeset 5587:490cb80dfb06 in roaraudio
- Timestamp:
- 07/22/12 11:47:51 (12 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroardsp/dtmf.c
r5553 r5587 209 209 int roar_dtmf_tone (int16_t * samples, const size_t len, const uint32_t rate, const int options, const uint16_t c) { 210 210 const struct tone * ct = NULL; 211 #ifdef ROAR_HAVE_LIBM 211 212 size_t i; 212 213 float t; 213 214 float t_inc = 1./rate; 214 215 float fc0, fc1; 216 #endif 215 217 216 218 ROAR_DBG("roar_dtmf_tone(samples=%p, len=%llu, rate=%lu, options=%i, c=%i) = ?", samples, (long long unsigned int)len, (long unsigned int)rate, options, (int)c); … … 231 233 } 232 234 235 #ifdef ROAR_HAVE_LIBM 233 236 fc0 = 2. * M_PI * ct->f0; 234 237 fc1 = 2. * M_PI * ct->f1; … … 239 242 samples[i] = (sinf(fc0*t) + sinf(fc1*t))*8192.0; 240 243 } 244 #else 245 roar_err_set(ROAR_ERROR_NOTSUP); 246 return -1; 247 #endif 241 248 242 249 return 0;
Note: See TracChangeset
for help on using the changeset viewer.