Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Selected Reading
CSS pitch property
The CSS pitch property specifies the average pitch (frequency) of the speaking voice in speech synthesis. The average pitch varies based on the voice family − for example, a standard male voice averages around 120Hz, while a female voice averages around 210Hz.
Syntax
selector {
pitch: value;
}
Possible Values
| Value | Description |
|---|---|
frequency |
Specifies the average pitch in hertz (Hz) |
x-low |
Extra low pitch relative to voice family |
low |
Low pitch relative to voice family |
medium |
Medium pitch relative to voice family (default) |
high |
High pitch relative to voice family |
x-high |
Extra high pitch relative to voice family |
Example: Setting Voice Pitch
The following example demonstrates different pitch values for speech synthesis −
<!DOCTYPE html>
<html>
<head>
<style>
.low-pitch {
pitch: low;
}
.high-pitch {
pitch: high;
}
.frequency-pitch {
pitch: 180Hz;
}
.speech-text {
font-family: Arial, sans-serif;
padding: 10px;
margin: 10px 0;
border: 1px solid #ccc;
border-radius: 5px;
}
</style>
</head>
<body>
<div class="speech-text low-pitch">This text will be spoken with low pitch</div>
<div class="speech-text high-pitch">This text will be spoken with high pitch</div>
<div class="speech-text frequency-pitch">This text will be spoken at 180Hz frequency</div>
</body>
</html>
Three bordered text boxes appear on the page. The pitch property affects speech synthesis when content is read aloud by screen readers or speech synthesizers, with the first box using low pitch, second using high pitch, and third using a specific 180Hz frequency.
Note: The pitch property is part of CSS Speech Module and requires speech synthesis support in the browser or assistive technology to be audible. Most modern browsers do not directly support CSS speech properties for standard web content.
Conclusion
The pitch property controls the speaking voice frequency in speech synthesis. While keyword values adapt to the voice family, specific Hz values provide precise control over the pitch.
Advertisements
