|
|
@@ -30,15 +30,13 @@ |
|
|
#include <stdlib.h> |
|
|
#include <stdlib.h> |
|
|
#include <stdio.h> |
|
|
#include <stdio.h> |
|
|
#include <string.h> |
|
|
#include <string.h> |
|
|
#include <math.h> |
|
|
|
|
|
|
|
|
|
|
|
#define PI 3.14159265358979323846 |
|
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_AV_CONFIG_H |
|
|
#ifdef HAVE_AV_CONFIG_H |
|
|
#undef HAVE_AV_CONFIG_H |
|
|
#undef HAVE_AV_CONFIG_H |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
#include "avcodec.h" |
|
|
#include "avcodec.h" |
|
|
|
|
|
#include "libavutil/mathematics.h" |
|
|
|
|
|
|
|
|
#define INBUF_SIZE 4096 |
|
|
#define INBUF_SIZE 4096 |
|
|
|
|
|
|
|
|
@@ -91,7 +89,7 @@ void audio_encode_example(const char *filename) |
|
|
|
|
|
|
|
|
/* encode a single tone sound */ |
|
|
/* encode a single tone sound */ |
|
|
t = 0; |
|
|
t = 0; |
|
|
tincr = 2 * PI * 440.0 / c->sample_rate; |
|
|
|
|
|
|
|
|
tincr = 2 * M_PI * 440.0 / c->sample_rate; |
|
|
for(i=0;i<200;i++) { |
|
|
for(i=0;i<200;i++) { |
|
|
for(j=0;j<frame_size;j++) { |
|
|
for(j=0;j<frame_size;j++) { |
|
|
samples[2*j] = (int)(sin(t) * 10000); |
|
|
samples[2*j] = (int)(sin(t) * 10000); |
|
|
|