File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -127,7 +127,12 @@ class SourceEdit extends Component {
127
127
}
128
128
129
129
getMaxChannels ( codec , samples ) {
130
- let maxChannels = Math . floor ( max_packet_size / ( samples * ( codec === 'L16' ? 2 : 3 ) ) ) ;
130
+ let sampleSize = 4
131
+ if ( codec === 'L16' )
132
+ sampleSize = 2
133
+ if ( codec === 'L24' )
134
+ sampleSize = 3
135
+ let maxChannels = Math . floor ( max_packet_size / ( samples * sampleSize ) ) ;
131
136
return maxChannels > 64 ? 64 : maxChannels ;
132
137
}
133
138
@@ -139,7 +144,7 @@ class SourceEdit extends Component {
139
144
140
145
onChangeCodec ( e ) {
141
146
let codec = e . target . value ;
142
- let maxChannels = this . getMaxChannels ( this . state . codec , this . state . maxSamplesPerPacket ) ;
147
+ let maxChannels = this . getMaxChannels ( codec , this . state . maxSamplesPerPacket ) ;
143
148
this . setState ( { codec : codec , maxChannels : maxChannels , channelsErr : this . state . channels > maxChannels } ) ;
144
149
}
145
150
You can’t perform that action at this time.
0 commit comments