Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

uriahheep
Friday, September 3rd, 2010 at 4:34:41pm MDT 

  1. /***************************************************************************
  2.    Copyright (C) 2004-2006 by Jean-Marc Valin
  3.    Copyright (C) 2006 Commonwealth Scientific and Industrial Research
  4.                       Organisation (CSIRO) Australia
  5.  
  6.    Redistribution and use in source and binary forms, with or without
  7.    modification, are permitted provided that the following conditions
  8.    are met:
  9.    
  10.    - Redistributions of source code must retain the above copyright
  11.    notice, this list of conditions and the following disclaimer.
  12.    
  13.    - Redistributions in binary form must reproduce the above copyright
  14.    notice, this list of conditions and the following disclaimer in the
  15.    documentation and/or other materials provided with the distribution.
  16.    
  17.    - Neither the name of the Xiph.org Foundation nor the names of its
  18.    contributors may be used to endorse or promote products derived from
  19.    this software without specific prior written permission.
  20.    
  21.    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22.    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23.    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  24.    A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR
  25.    CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  26.    EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  27.    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  28.    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  29.    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  30.    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  31.    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32.    
  33. ****************************************************************************/
  34.  
  35. #ifdef HAVE_CONFIG_H
  36. #include <config.h>
  37. #endif
  38.  
  39. #include <stdlib.h>
  40. #include <sys/types.h>
  41. #include <sys/socket.h>
  42. #include <netinet/in.h>
  43. #include <arpa/inet.h>
  44. #include <netdb.h>
  45. #include <stdio.h>
  46. #include <unistd.h> /* close() */
  47. #include <string.h> /* memset() */
  48.  
  49. /* #include "alsa_device.h" */
  50.  
  51. /* begin playwav2.c paste */
  52.  
  53. #include <fcntl.h>
  54. #include <stdint.h>
  55. #include <sys/mman.h>
  56. #include <sys/ioctl.h>
  57.  
  58. #include <linux/ioctl.h>
  59.  
  60. /* end playwav2.c paste */
  61.  
  62. #include <speex/speex.h>
  63. #include <speex/speex_jitter.h>
  64. #include <speex/speex_preprocess.h>
  65. #include <speex/speex_echo.h>
  66. #include "speex_jitter_buffer.h"
  67.  
  68. #include <sched.h>
  69.  
  70. /* begin playwav2.c paste */
  71.  
  72. #if 0
  73. #include <linux/msm_audio.h>
  74. #else
  75. /* ---------- linux/msm_audio.h -------- */
  76.  
  77. #define AUDIO_IOCTL_MAGIC 'a'
  78.  
  79. #define AUDIO_START        _IOW(AUDIO_IOCTL_MAGIC, 0, unsigned)
  80. #define AUDIO_STOP         _IOW(AUDIO_IOCTL_MAGIC, 1, unsigned)
  81. #define AUDIO_FLUSH        _IOW(AUDIO_IOCTL_MAGIC, 2, unsigned)
  82. #define AUDIO_GET_CONFIG   _IOR(AUDIO_IOCTL_MAGIC, 3, unsigned)
  83. #define AUDIO_SET_CONFIG   _IOW(AUDIO_IOCTL_MAGIC, 4, unsigned)
  84. #define AUDIO_GET_STATS    _IOR(AUDIO_IOCTL_MAGIC, 5, unsigned)
  85. #define AUDIO_ENABLE_AUDPP _IOW(AUDIO_IOCTL_MAGIC, 6, unsigned)
  86. #define AUDIO_SET_ADRC     _IOW(AUDIO_IOCTL_MAGIC, 7, unsigned)
  87. #define AUDIO_SET_EQ       _IOW(AUDIO_IOCTL_MAGIC, 8, unsigned)
  88. #define AUDIO_SET_RX_IIR   _IOW(AUDIO_IOCTL_MAGIC, 9, unsigned)
  89.  
  90. #define EQ_MAX_BAND_NUM 12
  91.  
  92. #define ADRC_ENABLE  0x0001
  93. #define ADRC_DISABLE 0x0000
  94. #define EQ_ENABLE    0x0002
  95. #define EQ_DISABLE   0x0000
  96. #define IIR_ENABLE   0x0004
  97. #define IIR_DISABLE  0x0000
  98.  
  99. struct eq_filter_type
  100. {
  101.   int16_t gain;
  102.   uint16_t freq;
  103.   uint16_t type;
  104.   uint16_t qf;
  105. };
  106.  
  107. struct eqalizer
  108. {
  109.   uint16_t bands;
  110.   uint16_t params[132];
  111. };
  112.  
  113. struct rx_iir_filter
  114. {
  115.   uint16_t num_bands;
  116.   uint16_t iir_params[48];
  117. };
  118.  
  119.  
  120. struct msm_audio_config
  121. {
  122.   uint32_t buffer_size;
  123.   uint32_t buffer_count;
  124.   uint32_t channel_count;
  125.   uint32_t sample_rate;
  126.   uint32_t codec_type;
  127.   uint32_t unused[3];
  128. };
  129.  
  130. struct msm_audio_stats
  131. {
  132.   uint32_t out_bytes;
  133.   uint32_t unused[3];
  134. };
  135.  
  136. /* Audio routing */
  137.  
  138. #define SND_IOCTL_MAGIC 's'
  139.  
  140. #define SND_MUTE_UNMUTED 0
  141. #define SND_MUTE_MUTED   1
  142.  
  143. struct msm_snd_device_config
  144. {
  145.   uint32_t device;
  146.   uint32_t ear_mute;
  147.   uint32_t mic_mute;
  148. };
  149.  
  150. #define SND_SET_DEVICE _IOW(SND_IOCTL_MAGIC, 2, struct msm_device_config *)
  151.  
  152. #define SND_METHOD_VOICE 0
  153.  
  154. #define SND_METHOD_VOICE_1 1
  155.  
  156. struct msm_snd_volume_config
  157. {
  158.   uint32_t device;
  159.   uint32_t method;
  160.   uint32_t volume;
  161. };
  162.  
  163. #define SND_SET_VOLUME _IOW(SND_IOCTL_MAGIC, 3, struct msm_snd_volume_config *)
  164.  
  165. /* Returns the number of SND endpoints supported. */
  166.  
  167. #define SND_GET_NUM_ENDPOINTS _IOR(SND_IOCTL_MAGIC, 4, unsigned *)
  168.  
  169. struct msm_snd_endpoint
  170. {
  171.   int id;                       /* input and output */
  172.   char name[64];                /* output only */
  173. };
  174.  
  175. /* Takes an index between 0 and one less than the number returned by
  176. * SND_GET_NUM_ENDPOINTS, and returns the SND index and name of a
  177. * SND endpoint.  On input, the .id field contains the number of the
  178. * endpoint, and on exit it contains the SND index, while .name contains
  179. * the description of the endpoint.
  180. */
  181.  
  182. #define SND_GET_ENDPOINT _IOWR(SND_IOCTL_MAGIC, 5, struct msm_snd_endpoint *)
  183.  
  184. #endif
  185. /* ----------  -------- */
  186.  
  187. static int
  188. do_route_audio_rpc (uint32_t device, int ear_mute, int mic_mute)
  189. {
  190.   if (device == -1UL)
  191.     return 0;
  192.  
  193.   int fd;
  194.  
  195.   printf ("rpc_snd_set_device(%d, %d, %d)\n", device, ear_mute, mic_mute);
  196.  
  197.   fd = open ("/dev/msm_snd", O_RDWR);
  198.   if (fd < 0)
  199.     {
  200.       perror ("Can not open snd device");
  201.       return -1;
  202.     }
  203.   // RPC call to switch audio path
  204.   /* rpc_snd_set_device(
  205.    *     device,            # Hardware device enum to use
  206.    *     ear_mute,          # Set mute for outgoing voice audio
  207.    *                        # this should only be unmuted when in-call
  208.    *     mic_mute,          # Set mute for incoming voice audio
  209.    *                        # this should only be unmuted when in-call or
  210.    *                        # recording.
  211.    *  )
  212.    */
  213.   struct msm_snd_device_config args;
  214.   args.device = device;
  215.   args.ear_mute = ear_mute ? SND_MUTE_MUTED : SND_MUTE_UNMUTED;
  216.   args.mic_mute = mic_mute ? SND_MUTE_MUTED : SND_MUTE_UNMUTED;
  217.  
  218.   if (ioctl (fd, SND_SET_DEVICE, &args) < 0)
  219.     {
  220.       perror ("snd_set_device error.");
  221.       close (fd);
  222.       return -1;
  223.     }
  224.  
  225.   close (fd);
  226.   return 0;
  227. }
  228.  
  229. static int
  230. set_volume_rpc (uint32_t device, uint32_t method, uint32_t volume)
  231. {
  232.   int fd;
  233.  
  234.   printf ("rpc_snd_set_volume(%d, %d, %d)\n", device, method, volume);
  235.  
  236.   if (device == -1UL)
  237.     return 0;
  238.  
  239.   fd = open ("/dev/msm_snd", O_RDWR);
  240.   if (fd < 0)
  241.     {
  242.       perror ("Can not open snd device");
  243.       return -1;
  244.     }
  245.   /* rpc_snd_set_volume(
  246.    *     device,            # Any hardware device enum, including
  247.    *                        # SND_DEVICE_CURRENT
  248.    *     method,            # must be SND_METHOD_VOICE to do anything useful
  249.    *     volume,            # integer volume level, in range [0,5].
  250.    *                        # note that 0 is audible (not quite muted)
  251.    *  )
  252.    * rpc_snd_set_volume only works for in-call sound volume.
  253.    */
  254.   struct msm_snd_volume_config args;
  255.   args.device = device;
  256.   args.method = method;
  257.   args.volume = volume;
  258.  
  259.   if (ioctl (fd, SND_SET_VOLUME, &args) < 0)
  260.     {
  261.       perror ("snd_set_volume error.");
  262.       close (fd);
  263.       return -1;
  264.     }
  265.   close (fd);
  266.   return 0;
  267. }
  268.  
  269. static char *next;
  270. static unsigned avail;
  271.  
  272. /* end playwav2.c paste */
  273.  
  274. #define MAX_MSG 1500
  275.  
  276. #define SAMPLING_RATE 8000
  277. #define FRAME_SIZE 320
  278.  
  279. int main(int argc, char *argv[])
  280. {
  281.    
  282.    int sd, rc, n;
  283.    int i;
  284.    struct sockaddr_in cliAddr, remoteAddr;
  285.    char msg[MAX_MSG];
  286.    struct hostent *h;
  287.    int local_port, remote_port;
  288.    int nfds;
  289.    struct pollfd *pfds;
  290.    SpeexPreprocessState *preprocess;
  291.    /*AlsaDevice *audio_dev;*/
  292.    int tmp;
  293.  
  294.    if (argc != 5)
  295.    {
  296.       fprintf(stderr, "wrong options\n");
  297.       exit(1);
  298.    }
  299.  
  300.    h = gethostbyname(argv[2]);
  301.    if(h==NULL) {
  302.       fprintf(stderr, "%s: unknown host '%s' \n", argv[0], argv[1]);
  303.       exit(1);
  304.    }
  305.  
  306.    local_port = atoi(argv[3]);
  307.    remote_port = atoi(argv[4]);
  308.    
  309.    printf("%s: sending data to '%s' (IP : %s) \n", argv[0], h->h_name,
  310.           inet_ntoa(*(struct in_addr *)h->h_addr_list[0]));
  311.  
  312.    {
  313.       remoteAddr.sin_family = h->h_addrtype;
  314.       memcpy((char *) &remoteAddr.sin_addr.s_addr,
  315.             h->h_addr_list[0], h->h_length);
  316.       remoteAddr.sin_port = htons(remote_port);
  317.    }
  318.    /* socket creation */
  319.    sd=socket(AF_INET, SOCK_DGRAM, 0);
  320.    if(sd<0) {
  321.       printf("%s: cannot open socket \n",argv[0]);
  322.       exit(1);
  323.    }
  324.  
  325.    /* bind any port */
  326.    cliAddr.sin_family = AF_INET;
  327.    cliAddr.sin_addr.s_addr = htonl(INADDR_ANY);
  328.    cliAddr.sin_port = htons(local_port);
  329.  
  330.    rc = bind(sd, (struct sockaddr *) &cliAddr, sizeof(cliAddr));
  331.    if(rc<0) {
  332.       printf("%s: cannot bind port\n", argv[0]);
  333.       exit(1);
  334.    }
  335.  
  336.    /* Setup audio device */
  337.    /* audio_dev = alsa_device_open(argv[1], SAMPLING_RATE, 1, FRAME_SIZE); */
  338.  
  339. /* begin playwav2.c paste */
  340.  
  341.   int fd = open ("/dev/msm_snd", O_RDWR);
  342.   int mNumSndEndpoints;
  343.  
  344.   if (fd >= 0)
  345.     {
  346.       int rc = ioctl (fd, SND_GET_NUM_ENDPOINTS,
  347.                       &mNumSndEndpoints);
  348.  
  349.       printf ("found %d snd endpoints\n", mNumSndEndpoints);
  350.  
  351.       if (rc >= 0)
  352.         {
  353.           struct msm_snd_endpoint ept;
  354.           int cnt;
  355.  
  356.           for (cnt = 0; cnt < mNumSndEndpoints; cnt++)
  357.             {
  358.               ept.id = cnt;
  359.               ioctl (fd, SND_GET_ENDPOINT, &ept);
  360.               printf ("    %02d: %s / %d\n", cnt, ept.name, ept.id);
  361.             }
  362.         }
  363.       else
  364.         perror ("Could not retrieve number of MSM SND endpoints.");
  365.       close (fd);
  366.     }
  367.   else
  368.     perror ("Could not open MSM SND driver.");
  369.  
  370.   printf ("Select device %d.\n", 0);
  371.  
  372. //  do_route_audio_rpc (0, SND_MUTE_MUTED, SND_MUTE_MUTED);
  373.   do_route_audio_rpc(0,SND_MUTE_UNMUTED,SND_MUTE_UNMUTED);
  374.  
  375.  
  376. //  printf ("enable PP\n");
  377. //  msm72xx_enable_audpp(ADRC_ENABLE | EQ_ENABLE | IIR_ENABLE);
  378.  
  379.   printf ("Set master volume to %d.\n", 5);
  380. #if 0
  381.   set_volume_rpc (SND_DEVICE_HANDSET, SND_METHOD_VOICE, vol);
  382.   set_volume_rpc (SND_DEVICE_SPEAKER, SND_METHOD_VOICE, vol);
  383.   set_volume_rpc (SND_DEVICE_BT, SND_METHOD_VOICE, vol);
  384.   set_volume_rpc (SND_DEVICE_HEADSET, SND_METHOD_VOICE, vol);
  385. #endif
  386.  
  387.   /* dev=0xd ? */
  388.   set_volume_rpc (0xd, SND_METHOD_VOICE_1, 5);
  389.  
  390. /* end playwav2.c paste */
  391.  
  392.    /* Setup the encoder and decoder in wideband */
  393.    void *enc_state, *dec_state;
  394.    enc_state = speex_encoder_init(&speex_nb_mode);
  395.    tmp = 8;
  396.    speex_encoder_ctl(enc_state, SPEEX_SET_QUALITY, &tmp);
  397.    tmp = 2;
  398.    speex_encoder_ctl(enc_state, SPEEX_SET_COMPLEXITY, &tmp);
  399.    dec_state = speex_decoder_init(&speex_nb_mode);
  400.    tmp = 1;
  401.    speex_decoder_ctl(dec_state, SPEEX_SET_ENH, &tmp);
  402.    SpeexBits enc_bits, dec_bits;
  403.    speex_bits_init(&enc_bits);
  404.    speex_bits_init(&dec_bits);
  405.    
  406.    
  407.    struct sched_param param;
  408.    /*param.sched_priority = 40; */
  409.    param.sched_priority = sched_get_priority_min(SCHED_FIFO);
  410.    if (sched_setscheduler(0,SCHED_FIFO,&param))
  411.       perror("sched_setscheduler");
  412.  
  413.    int send_timestamp = 0;
  414.    int recv_started=0;
  415.    
  416.    /* Setup all file descriptors for poll()ing */
  417.    /* nfds = alsa_device_nfds(audio_dev); */
  418.    nfds = 2;
  419.    pfds = malloc(sizeof(*pfds)*(nfds+1));
  420.    /* alsa_device_getfds(audio_dev, pfds, nfds); */
  421.    pfds[0].fd = open("/dev/msm_pcm_in", O_RDWR);
  422.    pfds[0].events = POLLIN;
  423.    pfds[1].fd = open("/dev/msm_pcm_out", O_RDWR);
  424.    pfds[1].events = POLLOUT;
  425.    pfds[nfds].fd = sd;
  426.    pfds[nfds].events = POLLIN;
  427.  
  428.    /* Setup jitter buffer using decoder */
  429.    SpeexJitter jitter;
  430.    speex_jitter_init(&jitter, dec_state, SAMPLING_RATE);
  431.    
  432.    /* Echo canceller with 200 ms tail length */
  433.    SpeexEchoState *echo_state = speex_echo_state_init(FRAME_SIZE, 10*FRAME_SIZE);
  434.    tmp = SAMPLING_RATE;
  435.    speex_echo_ctl(echo_state, SPEEX_ECHO_SET_SAMPLING_RATE, &tmp);
  436.  
  437.    /* Setup preprocessor and associate with echo canceller for residual echo suppression */
  438.    preprocess = speex_preprocess_state_init(FRAME_SIZE, SAMPLING_RATE);
  439.    speex_preprocess_ctl(preprocess, SPEEX_PREPROCESS_SET_ECHO_STATE, echo_state);
  440.    
  441.    /* alsa_device_start(audio_dev); */
  442.  
  443. /* begin playwav2.c paste */
  444.  
  445. //  unsigned char buf[8192];
  446.   struct msm_audio_config cfg;
  447.  
  448.   if (pfds[0].fd < 0)
  449.     {
  450.       perror ("cannot open msm_pcm_in");
  451.       return -1;
  452.     }
  453.  
  454.   /* config change should be a read-modify-write operation */
  455.   if (ioctl (pfds[0].fd, AUDIO_GET_CONFIG, &cfg))
  456.     {
  457.       perror ("cannot read write audio config");
  458.       return -1;
  459.     }
  460.  
  461.   cfg.channel_count = 1;
  462.   cfg.sample_rate = 8000;
  463.   cfg.buffer_size = 320;
  464.   if (ioctl (pfds[0].fd, AUDIO_SET_CONFIG, &cfg))
  465.     {
  466.       perror ("cannot write write audio config");
  467.       return -1;
  468.     }
  469.  
  470.   if (ioctl (pfds[0].fd, AUDIO_GET_CONFIG, &cfg))
  471.     {
  472.       perror ("cannot read write audio config");
  473.       return -1;
  474.     }
  475.  
  476.   if (ioctl (pfds[0].fd, AUDIO_START, 0))
  477.     {
  478.       perror ("cannot start write audio");
  479.       return -1;
  480.     }
  481.  
  482.   struct msm_audio_config config;
  483.   struct msm_audio_stats stats;
  484.  
  485.   if (pfds[1].fd < 0)
  486.     {
  487.       perror ("pcm_play: cannot open audio device");
  488.       return -1;
  489.     }
  490.  
  491.   if (ioctl (pfds[1].fd, AUDIO_GET_CONFIG, &config))
  492.     {
  493.       perror ("could not get read config");
  494.       return -1;
  495.     }
  496.  
  497.   config.channel_count = 1;
  498.   config.sample_rate = 8000;
  499.   config.buffer_size = 320;
  500.   if (ioctl (pfds[1].fd, AUDIO_SET_CONFIG, &config))
  501.     {
  502.       perror ("could not set read config");
  503.       return -1;
  504.     }
  505.  
  506.   /* removed prefill from here */
  507.  
  508.   ioctl (pfds[1].fd, AUDIO_START, 0);
  509.  
  510. /* end playwav2.c paste */
  511.  
  512.    /* Infinite loop on capture, playback and receiving packets */
  513.    while (1)
  514.    {
  515.       /* Wait for either 1) capture 2) playback 3) socket data */
  516.       poll(pfds, nfds+1, -1);
  517.       /* Received packets */
  518.       if (pfds[nfds].revents & POLLIN)
  519.       {
  520.          /*fprintf (stderr, "x");*/
  521.          n = recv(sd, msg, MAX_MSG, 0);
  522.          int recv_timestamp = ((int*)msg)[1];
  523.          int payload = ((int*)msg)[0];
  524.    
  525.          if ((payload & 0x80000000) == 0)
  526.          {
  527.             /* Put content of the packet into the jitter buffer, except for the pseudo-header */
  528.             speex_jitter_put(&jitter, msg+8, n-8, recv_timestamp);
  529.             recv_started = 1;
  530.          }
  531.  
  532.       }
  533.       /* Ready to play a frame (playback) */
  534. //      if (alsa_device_playback_ready(audio_dev, pfds, nfds))
  535. //      {
  536.          short pcm[FRAME_SIZE];
  537.          if (recv_started)
  538.          {
  539.             /* Get audio from the jitter buffer */
  540.             speex_jitter_get(&jitter, pcm, NULL);
  541.          } else {
  542.             for (i=0;i<FRAME_SIZE;i++)
  543.                pcm[i] = 0;
  544.          }
  545.          /* Playback the audio and reset the echo canceller if we got an underrun */
  546. //         if (alsa_device_write(audio_dev, pcm, FRAME_SIZE))
  547. #if 0
  548.       if (ioctl (pfds[1].fd, AUDIO_GET_STATS, &stats) == 0)
  549.         fprintf (stderr, "%10d\n", stats.out_bytes);
  550. #endif
  551.          if (write (pfds[1].fd, pcm, FRAME_SIZE))
  552.             speex_echo_state_reset(echo_state);
  553.          /* Put frame into playback buffer */
  554.          speex_echo_playback(echo_state, pcm);
  555. //      }
  556.       /* Audio available from the soundcard (capture) */
  557. //      if (alsa_device_capture_ready(audio_dev, pfds, nfds))
  558. //      {
  559.          short pcm[FRAME_SIZE], pcm2[FRAME_SIZE];
  560.          char outpacket[MAX_MSG];
  561.          /* Get audio from the soundcard */
  562. //         alsa_device_read(audio_dev, pcm, FRAME_SIZE);
  563.          read (pfds[0].fd, pcm, FRAME_SIZE);
  564.          
  565.          /* Perform echo cancellation */
  566.          speex_echo_capture(echo_state, pcm, pcm2);
  567.          for (i=0;i<FRAME_SIZE;i++)
  568.             pcm[i] = pcm2[i];
  569.          
  570.          speex_bits_reset(&enc_bits);
  571.          
  572.          /* Apply noise/echo suppression */
  573.          speex_preprocess_run(preprocess, pcm);
  574.          
  575.          /* Encode */
  576.          speex_encode_int(enc_state, pcm, &enc_bits);
  577.          int packetSize = speex_bits_write(&enc_bits, outpacket+8, MAX_MSG);
  578.          
  579.          /* Pseudo header: four null bytes and a 32-bit timestamp */
  580.          ((int*)outpacket)[0] = htonl(0);
  581.          ((int*)outpacket)[1] = send_timestamp;
  582.          send_timestamp += FRAME_SIZE;
  583.          rc = sendto(sd, outpacket, packetSize+8, 0,
  584.                 (struct sockaddr *) &remoteAddr,
  585.                 sizeof(remoteAddr));
  586.          
  587.          if(rc<0) {
  588.             printf("cannot send audio data\n");
  589.             close(sd);
  590.             exit(1);
  591.          }
  592. //      }
  593.      
  594.  
  595.    }
  596.  
  597.  
  598.    return 0;
  599. }

advertising

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

fantasy-obligation