~ubuntu-branches/ubuntu/jaunty/xvidcap/jaunty-proposed

« back to all changes in this revision

Viewing changes to ffmpeg/tests/audiogen.c

  • Committer: Bazaar Package Importer
  • Author(s): John Dong
  • Date: 2008-02-25 15:47:12 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080225154712-qvr11ekcea4c9ry8
Tags: 1.1.6-0.1ubuntu1
* Merge from debian-multimedia (LP: #120003), Ubuntu Changes:
 - For ffmpeg-related build-deps, remove cvs from package names.
 - Standards-Version 3.7.3
 - Maintainer Spec

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * Generates a synthetic stereo sound
3
3
 * NOTE: no floats are used to guaranty a bit exact output.
 
4
 *
 
5
 * Copyright (c) 2002 Fabrice Bellard
 
6
 *
 
7
 * This file is part of FFmpeg.
 
8
 *
 
9
 * FFmpeg is free software; you can redistribute it and/or
 
10
 * modify it under the terms of the GNU Lesser General Public
 
11
 * License as published by the Free Software Foundation; either
 
12
 * version 2.1 of the License, or (at your option) any later version.
 
13
 *
 
14
 * FFmpeg is distributed in the hope that it will be useful,
 
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
17
 * Lesser General Public License for more details.
 
18
 *
 
19
 * You should have received a copy of the GNU Lesser General Public
 
20
 * License along with FFmpeg; if not, write to the Free Software
 
21
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
4
22
 */
 
23
 
5
24
#include <stdlib.h>
6
25
#include <stdio.h>
7
26
 
93
112
               "generate a test raw 16 bit stereo audio stream\n", argv[0]);
94
113
        exit(1);
95
114
    }
96
 
    
97
 
    outfile = fopen(argv[1], "w");
 
115
 
 
116
    outfile = fopen(argv[1], "wb");
98
117
    if (!outfile) {
99
118
        perror(argv[1]);
100
119
        return 1;
118
137
        f = 100 + (((10000 - 100) * i) / FE);
119
138
        a += (f * FRAC_ONE) / FE;
120
139
    }
121
 
    
 
140
 
122
141
    /* 0.5 second of low amplitude white noise */
123
142
    for(i=0;i<FE / 2;i++) {
124
143
        v = myrnd(&seed, 20000) - 10000;
147
166
            taba[j] += (f * FRAC_ONE) / FE;
148
167
        }
149
168
    }
150
 
    
 
169
 
151
170
    /* stereo 500 Hz with varying volume */
152
171
    a = 0;
153
172
    ampa = 0;