Changeset 5587:490cb80dfb06 in roaraudio


Ignore:
Timestamp:
07/22/12 11:47:51 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

make depends on libm optional

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroardsp/dtmf.c

    r5553 r5587  
    209209int roar_dtmf_tone (int16_t * samples, const size_t len, const uint32_t rate, const int options, const uint16_t c) { 
    210210 const struct tone * ct = NULL; 
     211#ifdef ROAR_HAVE_LIBM 
    211212 size_t i; 
    212213 float t; 
    213214 float t_inc = 1./rate; 
    214215 float fc0, fc1; 
     216#endif 
    215217 
    216218 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); 
     
    231233 } 
    232234 
     235#ifdef ROAR_HAVE_LIBM 
    233236 fc0 = 2. * M_PI * ct->f0; 
    234237 fc1 = 2. * M_PI * ct->f1; 
     
    239242  samples[i] = (sinf(fc0*t) + sinf(fc1*t))*8192.0; 
    240243 } 
     244#else 
     245 roar_err_set(ROAR_ERROR_NOTSUP); 
     246 return -1; 
     247#endif 
    241248 
    242249 return 0; 
Note: See TracChangeset for help on using the changeset viewer.