---
title: "How to send voice data via ethernet"
url: "https://maker.wiznet.io/irina/projects/how-to-send-voice-data-via-ethernet/"
markdown_url: "https://maker.wiznet.io/irina/projects/how-to-send-voice-data-via-ethernet/md"
type: "WCC: WIZnet Created Content"
author: "irina"
author_url: "https://maker.wiznet.io/irina/"
original_author: "irina"
license: "Apache License 2.0 (Apache-2.0)"
published: "2024-10-31"
language: "en"
hardware: ["WIZnet W55RP20-EVB-Pico", "Adafruit Microphone Amplifier Breakout"]
likes: 0
views: 3726
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# How to send voice data via ethernet

> Using the W55RP20, audio data is transmitted via UDP, then processed using Azure's cloud services. If audio data is transmitted over Ethernet....

Original author: irina

## Components

- **WIZnet W55RP20-EVB-Pico** x 1 ([docs](https://wiznet.io/products/powered-by-raspberry-pi/w55rp20-evb-pico))
- **Adafruit Microphone Amplifier Breakout** x 1 ([docs](https://www.adafruit.com/product/1063))

## Article

## Base Project

[*https://github.com/WIZnet-ioNIC/WIZnet-PICO-AZURE-C*](https://github.com/WIZnet-ioNIC/WIZnet-PICO-AZURE-C)

To use Azure cloud services, I choose the WIZnet-PICO-AZURE-C library, which we believe will allow us to avoid switching to another project during development.

1. Open WIZnet-ioNIC/example/main.c and add the ADC sensing code

```plaintext
#define ADC_NUM 0
#define ADC_PIN (26 + ADC_NUM)
#define ADC_VREF 3.3
#define ADC_RANGE (1 << 12)
#define ADC_CONVERT (ADC_VREF / (ADC_RANGE - 1))
#define ADC_CLK_VAL 2999
```

```plaintext
stdio_init_all();
printf("Beep boop, listening...\n");
bi_decl(bi_program_description("Analog microphone example for Raspberry Pi Pico")); // for picotool
```

```plaintext
adc_fifo_setup(
true,    // Write each completed conversion to the sample FIFO
true,    // Enable DMA data request (DREQ)
1,       // DREQ (and IRQ) asserted when at least 1 sample present
true,   // We won't see the ERR bit because of 8 bit reads; disable.
false // Shift each sample to 8 bits when pushing to FIFO
);
```

```plaintext
adc_set_clkdiv(ADC_CLK_VAL);//2999= 16kS/s
```

> This explanation describes the process of setting up the sampling rate for an ADC (Analog-to-Digital Converter).
>
> **Base Clock**:
> The ADC clock (ADC CLK) is set to 48 MHz.
>
> **Divider**:
> To reduce the ADC sampling rate, a divider is used. The divider takes the input clock and divides it by a specified value to determine the actual sampling rate of the ADC.
>
> **Divider Calculation**:
> The divider is set to 1 + 2999, where 2999 is the user-defined value. Therefore, the divider is calculated as follows:
>
> 1. ADC Divider=1+2999=3000
>
> **Sampling Rate Calculation**:
> The ADC sampling rate is determined by dividing the input clock by the divider.
>
> 1. ADC Sampling Rate=300048 MHz​=16 kS/s
>
> Through this calculation, the ADC is configured to sample at a rate of 16,000 samples per second (16 kS/s).
>
> In summary, by dividing the 48 MHz clock by 3000, a sampling rate of 16 kS/s is achieved. This sampling rate is chosen based on the required resolution for digitizing the signal.

*Before using the Raspberry Pi board, we will first work on the W55RP20 board and microphone component.*

![](https://maker.wiznet.io/upload/ckeditor5/264348616%5F1730390698%2Epng)

The following flowchart has been prepared in advance.

![](https://maker.wiznet.io/upload/ckeditor5/264348616%5F1730390880%2Epng)

![](https://maker.wiznet.io/upload/ckeditor5/264348616%5F1730391172%2Epng)

---

Source: https://maker.wiznet.io/irina/projects/how-to-send-voice-data-via-ethernet/
