# Number of wave modes in a cavity

I'm trying to calculate the number of acoustic modes that can exist in a room in a certain range of frequencies. I thought of using the Rayleigh-Jeans formula for the electromagnetic standing wave modes possible in a cavity ($\frac{dN}{d\nu}=\frac{8\pi V}{c^3}\nu^2$), dividing by two to account for the fact that longitudinal waves such as sound do not have two different polarizations.

I'm not sure that this formula is valid for a non-cubical cavity, though, because the development represents the modes as points in 3d "mode space", and counts them by looking how many of the points are included within a sphere. If the cavity is not a cube, wouldn't there be more modes in a direction than in another, stretching the sphere into an ellipsoid?

My book (Eisberg-Resnick, "Quantum Physics") says that the formula is valid for an arbitrary cavity, but doesn't explain that statement. Can someone explain to me why I'm wrong?
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7250449061393738, "perplexity": 263.85729901602934}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-22/segments/1558232257939.82/warc/CC-MAIN-20190525084658-20190525110658-00356.warc.gz"}